@react-spectrum/s2 3.0.0-nightly-835f0aa1b-250107 → 3.0.0-nightly-d87cc4422-250109

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 (217) hide show
  1. package/dist/Accordion.cjs +3 -3
  2. package/dist/Accordion.css +2 -2
  3. package/dist/Accordion.mjs +3 -3
  4. package/dist/ActionBar.cjs +32 -32
  5. package/dist/ActionBar.css +34 -34
  6. package/dist/ActionBar.mjs +32 -32
  7. package/dist/ActionButton.cjs +61 -61
  8. package/dist/ActionButton.css +56 -56
  9. package/dist/ActionButton.mjs +61 -61
  10. package/dist/ActionButtonGroup.cjs +4 -4
  11. package/dist/ActionButtonGroup.css +3 -3
  12. package/dist/ActionButtonGroup.mjs +4 -4
  13. package/dist/Avatar.cjs +10 -10
  14. package/dist/Avatar.css +11 -11
  15. package/dist/Avatar.mjs +10 -10
  16. package/dist/AvatarGroup.cjs +97 -97
  17. package/dist/AvatarGroup.css +31 -31
  18. package/dist/AvatarGroup.mjs +97 -97
  19. package/dist/Badge.cjs +31 -31
  20. package/dist/Badge.css +33 -33
  21. package/dist/Badge.mjs +31 -31
  22. package/dist/Breadcrumbs.cjs +83 -82
  23. package/dist/Breadcrumbs.cjs.map +1 -1
  24. package/dist/Breadcrumbs.css +65 -59
  25. package/dist/Breadcrumbs.css.map +1 -1
  26. package/dist/Breadcrumbs.mjs +83 -82
  27. package/dist/Breadcrumbs.mjs.map +1 -1
  28. package/dist/Button.cjs +82 -77
  29. package/dist/Button.cjs.map +1 -1
  30. package/dist/Button.css +65 -65
  31. package/dist/Button.css.map +1 -1
  32. package/dist/Button.mjs +82 -77
  33. package/dist/Button.mjs.map +1 -1
  34. package/dist/ButtonGroup.cjs +15 -15
  35. package/dist/ButtonGroup.css +11 -11
  36. package/dist/ButtonGroup.mjs +15 -15
  37. package/dist/Card.cjs +157 -157
  38. package/dist/Card.css +117 -117
  39. package/dist/Card.mjs +157 -157
  40. package/dist/CardView.cjs +13 -13
  41. package/dist/CardView.css +14 -14
  42. package/dist/CardView.mjs +13 -13
  43. package/dist/CenterBaseline.cjs +1 -1
  44. package/dist/CenterBaseline.css +2 -2
  45. package/dist/CenterBaseline.mjs +1 -1
  46. package/dist/Checkbox.cjs +46 -46
  47. package/dist/Checkbox.css +42 -42
  48. package/dist/Checkbox.mjs +46 -46
  49. package/dist/CheckboxGroup.cjs +36 -36
  50. package/dist/CheckboxGroup.css +32 -32
  51. package/dist/CheckboxGroup.mjs +36 -36
  52. package/dist/ClearButton.cjs +5 -5
  53. package/dist/ClearButton.css +5 -5
  54. package/dist/ClearButton.mjs +5 -5
  55. package/dist/CloseButton.cjs +15 -15
  56. package/dist/CloseButton.css +15 -15
  57. package/dist/CloseButton.mjs +15 -15
  58. package/dist/ColorArea.cjs +9 -9
  59. package/dist/ColorArea.css +9 -9
  60. package/dist/ColorArea.mjs +9 -9
  61. package/dist/ColorField.cjs +29 -29
  62. package/dist/ColorField.css +24 -24
  63. package/dist/ColorField.mjs +29 -29
  64. package/dist/ColorHandle.cjs +9 -9
  65. package/dist/ColorHandle.css +16 -16
  66. package/dist/ColorHandle.mjs +9 -9
  67. package/dist/ColorSlider.cjs +34 -34
  68. package/dist/ColorSlider.css +42 -42
  69. package/dist/ColorSlider.mjs +34 -34
  70. package/dist/ColorSwatch.cjs +6 -6
  71. package/dist/ColorSwatch.css +14 -14
  72. package/dist/ColorSwatch.mjs +6 -6
  73. package/dist/ColorSwatchPicker.cjs +12 -12
  74. package/dist/ColorSwatchPicker.css +32 -32
  75. package/dist/ColorSwatchPicker.mjs +12 -12
  76. package/dist/ColorWheel.cjs +14 -14
  77. package/dist/ColorWheel.css +14 -14
  78. package/dist/ColorWheel.mjs +14 -14
  79. package/dist/ComboBox.cjs +51 -48
  80. package/dist/ComboBox.cjs.map +1 -1
  81. package/dist/ComboBox.css +47 -47
  82. package/dist/ComboBox.css.map +1 -1
  83. package/dist/ComboBox.mjs +51 -48
  84. package/dist/ComboBox.mjs.map +1 -1
  85. package/dist/ContextualHelp.cjs +5 -5
  86. package/dist/ContextualHelp.css +23 -23
  87. package/dist/ContextualHelp.mjs +5 -5
  88. package/dist/CustomDialog.cjs +8 -8
  89. package/dist/CustomDialog.css +9 -9
  90. package/dist/CustomDialog.mjs +8 -8
  91. package/dist/Dialog.cjs +10 -10
  92. package/dist/Dialog.css +39 -39
  93. package/dist/Dialog.mjs +10 -10
  94. package/dist/Disclosure.cjs +53 -53
  95. package/dist/Disclosure.css +47 -47
  96. package/dist/Disclosure.mjs +53 -53
  97. package/dist/Divider.cjs +5 -5
  98. package/dist/Divider.css +5 -5
  99. package/dist/Divider.mjs +5 -5
  100. package/dist/DropZone.cjs +24 -24
  101. package/dist/DropZone.css +24 -24
  102. package/dist/DropZone.mjs +24 -24
  103. package/dist/Field.cjs +98 -98
  104. package/dist/Field.cjs.map +1 -1
  105. package/dist/Field.css +68 -68
  106. package/dist/Field.mjs +98 -98
  107. package/dist/Field.mjs.map +1 -1
  108. package/dist/Form.cjs +4 -4
  109. package/dist/Form.css +3 -3
  110. package/dist/Form.mjs +4 -4
  111. package/dist/FullscreenDialog.cjs +5 -5
  112. package/dist/FullscreenDialog.css +54 -54
  113. package/dist/FullscreenDialog.mjs +5 -5
  114. package/dist/IllustratedMessage.cjs +117 -117
  115. package/dist/IllustratedMessage.css +58 -58
  116. package/dist/IllustratedMessage.mjs +117 -117
  117. package/dist/Image.cjs +10 -10
  118. package/dist/Image.css +11 -11
  119. package/dist/Image.mjs +10 -10
  120. package/dist/InlineAlert.cjs +41 -41
  121. package/dist/InlineAlert.css +44 -44
  122. package/dist/InlineAlert.mjs +41 -41
  123. package/dist/Link.cjs +27 -27
  124. package/dist/Link.css +27 -27
  125. package/dist/Link.mjs +27 -27
  126. package/dist/Menu.cjs +278 -207
  127. package/dist/Menu.cjs.map +1 -1
  128. package/dist/Menu.css +114 -112
  129. package/dist/Menu.css.map +1 -1
  130. package/dist/Menu.mjs +278 -207
  131. package/dist/Menu.mjs.map +1 -1
  132. package/dist/Meter.cjs +45 -45
  133. package/dist/Meter.css +51 -51
  134. package/dist/Meter.mjs +45 -45
  135. package/dist/Modal.cjs +37 -37
  136. package/dist/Modal.css +35 -35
  137. package/dist/Modal.mjs +37 -37
  138. package/dist/NumberField.cjs +57 -57
  139. package/dist/NumberField.css +65 -65
  140. package/dist/NumberField.mjs +57 -57
  141. package/dist/Picker.cjs +114 -111
  142. package/dist/Picker.cjs.map +1 -1
  143. package/dist/Picker.css +79 -79
  144. package/dist/Picker.css.map +1 -1
  145. package/dist/Picker.mjs +114 -111
  146. package/dist/Picker.mjs.map +1 -1
  147. package/dist/Popover.cjs +40 -40
  148. package/dist/Popover.css +37 -37
  149. package/dist/Popover.mjs +40 -40
  150. package/dist/ProgressBar.cjs +57 -57
  151. package/dist/ProgressBar.css +61 -61
  152. package/dist/ProgressBar.mjs +57 -57
  153. package/dist/ProgressCircle.cjs +3 -3
  154. package/dist/ProgressCircle.css +2 -2
  155. package/dist/ProgressCircle.mjs +3 -3
  156. package/dist/Provider.cjs +4 -4
  157. package/dist/Provider.css +5 -5
  158. package/dist/Provider.mjs +4 -4
  159. package/dist/Radio.cjs +46 -46
  160. package/dist/Radio.css +42 -42
  161. package/dist/Radio.mjs +46 -46
  162. package/dist/RadioGroup.cjs +34 -34
  163. package/dist/RadioGroup.css +32 -32
  164. package/dist/RadioGroup.mjs +34 -34
  165. package/dist/SearchField.cjs +31 -31
  166. package/dist/SearchField.css +29 -29
  167. package/dist/SearchField.mjs +31 -31
  168. package/dist/SegmentedControl.cjs +54 -54
  169. package/dist/SegmentedControl.css +54 -54
  170. package/dist/SegmentedControl.mjs +54 -54
  171. package/dist/Slider.cjs +89 -89
  172. package/dist/Slider.css +82 -82
  173. package/dist/Slider.mjs +89 -89
  174. package/dist/StatusLight.cjs +26 -26
  175. package/dist/StatusLight.css +26 -26
  176. package/dist/StatusLight.mjs +26 -26
  177. package/dist/Switch.cjs +47 -47
  178. package/dist/Switch.css +40 -40
  179. package/dist/Switch.mjs +47 -47
  180. package/dist/TableView.cjs +137 -137
  181. package/dist/TableView.css +76 -76
  182. package/dist/TableView.mjs +137 -137
  183. package/dist/Tabs.cjs +60 -60
  184. package/dist/Tabs.css +52 -52
  185. package/dist/Tabs.mjs +60 -60
  186. package/dist/TabsPicker.cjs +63 -63
  187. package/dist/TabsPicker.css +61 -61
  188. package/dist/TabsPicker.mjs +63 -63
  189. package/dist/TagGroup.cjs +102 -102
  190. package/dist/TagGroup.css +84 -84
  191. package/dist/TagGroup.mjs +102 -102
  192. package/dist/TextField.cjs +36 -36
  193. package/dist/TextField.css +33 -33
  194. package/dist/TextField.mjs +36 -36
  195. package/dist/ToggleButton.cjs +3 -3
  196. package/dist/ToggleButton.css +7 -7
  197. package/dist/ToggleButton.mjs +3 -3
  198. package/dist/Tooltip.cjs +29 -29
  199. package/dist/Tooltip.css +31 -31
  200. package/dist/Tooltip.mjs +29 -29
  201. package/dist/types.d.ts +2 -0
  202. package/dist/types.d.ts.map +1 -1
  203. package/icons/Skeleton.cjs +2 -2
  204. package/icons/Skeleton.css +5 -5
  205. package/icons/Skeleton.mjs +2 -2
  206. package/package.json +19 -19
  207. package/src/Button.tsx +18 -7
  208. package/src/ComboBox.tsx +2 -1
  209. package/src/Menu.tsx +40 -17
  210. package/src/Picker.tsx +2 -1
  211. package/style/dist/spectrum-theme.cjs +12 -1
  212. package/style/dist/spectrum-theme.cjs.map +1 -1
  213. package/style/dist/spectrum-theme.mjs +12 -1
  214. package/style/dist/spectrum-theme.mjs.map +1 -1
  215. package/style/dist/types.d.ts +2 -0
  216. package/style/dist/types.d.ts.map +1 -1
  217. package/style/spectrum-theme.ts +9 -1
package/dist/Button.css CHANGED
@@ -1,9 +1,9 @@
1
1
  @layer _.a {
2
- ._La {
2
+ ._Ma {
3
3
  outline-style: none;
4
4
  }
5
5
 
6
- ._Lb {
6
+ ._Mb {
7
7
  outline-style: solid;
8
8
  }
9
9
 
@@ -15,11 +15,11 @@
15
15
  outline-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / 1);
16
16
  }
17
17
 
18
- ._Nc {
18
+ ._Oc {
19
19
  outline-width: 2px;
20
20
  }
21
21
 
22
- ._M-3t1z {
22
+ ._N-3t1z {
23
23
  outline-offset: 2px;
24
24
  }
25
25
 
@@ -31,23 +31,23 @@
31
31
  --s2-container-bg: black;
32
32
  }
33
33
 
34
- .Uc {
34
+ .Vc {
35
35
  position: relative;
36
36
  }
37
37
 
38
- ._Zd {
38
+ ._0d {
39
39
  display: flex;
40
40
  }
41
41
 
42
- ._1d {
42
+ ._2d {
43
43
  align-items: baseline;
44
44
  }
45
45
 
46
- ._2d {
46
+ ._3d {
47
47
  justify-content: center;
48
48
  }
49
49
 
50
- ._ja {
50
+ ._ka {
51
51
  text-align: start;
52
52
  }
53
53
 
@@ -55,37 +55,37 @@
55
55
  column-gap: .428571em;
56
56
  }
57
57
 
58
- ._ca {
58
+ ._da {
59
59
  font-family: adobe-clean-variable, adobe-clean, ui-sans-serif, system-ui, sans-serif;
60
60
  }
61
61
 
62
- ._de {
62
+ ._ee {
63
63
  font-size: .875rem;
64
64
  }
65
65
 
66
- ._da {
66
+ ._ea {
67
67
  font-size: .6875rem;
68
68
  }
69
69
 
70
- ._dc {
70
+ ._ec {
71
71
  font-size: .75rem;
72
72
  }
73
73
 
74
- ._dg {
74
+ ._eg {
75
75
  font-size: 1rem;
76
76
  }
77
77
 
78
- ._di {
78
+ ._ei {
79
79
  font-size: 1.125rem;
80
80
  }
81
81
 
82
- ._ed {
82
+ ._fd {
83
83
  font-variation-settings: "wght" 700;
84
84
  font-synthesis-weight: none;
85
85
  font-weight: 700;
86
86
  }
87
87
 
88
- ._fa {
88
+ ._ga {
89
89
  line-height: 1.3;
90
90
  }
91
91
 
@@ -125,7 +125,7 @@
125
125
  color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .21);
126
126
  }
127
127
 
128
- .__Da {
128
+ .__Ea {
129
129
  -webkit-user-select: none;
130
130
  user-select: none;
131
131
  }
@@ -134,23 +134,23 @@
134
134
  min-height: var(--o);
135
135
  }
136
136
 
137
- ._vg {
137
+ ._wg {
138
138
  border-start-start-radius: calc(var(--k, var(--o, 9999px)) / 2);
139
139
  }
140
140
 
141
- ._wg {
141
+ ._xg {
142
142
  border-start-end-radius: calc(var(--k, var(--o, 9999px)) / 2);
143
143
  }
144
144
 
145
- ._xg {
145
+ ._yg {
146
146
  border-end-start-radius: calc(var(--k, var(--o, 9999px)) / 2);
147
147
  }
148
148
 
149
- ._yg {
149
+ ._zg {
150
150
  border-end-end-radius: calc(var(--k, var(--o, 9999px)) / 2);
151
151
  }
152
152
 
153
- .__na {
153
+ .__oa {
154
154
  box-sizing: border-box;
155
155
  }
156
156
 
@@ -158,7 +158,7 @@
158
158
  width: fit-content;
159
159
  }
160
160
 
161
- ._ld {
161
+ ._md {
162
162
  text-decoration: none;
163
163
  }
164
164
 
@@ -178,15 +178,15 @@
178
178
  padding-bottom: 0;
179
179
  }
180
180
 
181
- ._Oa {
181
+ ._Pa {
182
182
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter;
183
183
  }
184
184
 
185
- ._Q-375x7f {
185
+ ._R-375x7f {
186
186
  transition-duration: .15s;
187
187
  }
188
188
 
189
- ._Ra {
189
+ ._Sa {
190
190
  transition-timing-function: cubic-bezier(.45, 0, .4, 1);
191
191
  }
192
192
 
@@ -262,23 +262,23 @@
262
262
  border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .17);
263
263
  }
264
264
 
265
- ._B-riuwfd {
265
+ ._C-riuwfd {
266
266
  background-image: linear-gradient(96deg, var(--lightningcss-light, #b539c8) var(--lightningcss-dark, #d549eb) 0%, var(--lightningcss-light, #7155fa) var(--lightningcss-dark, #8077fe) 66%, var(--lightningcss-light, #3b63fb) var(--lightningcss-dark, #5681ff) 100%);
267
267
  }
268
268
 
269
- ._B-2xhv0x {
269
+ ._C-2xhv0x {
270
270
  background-image: linear-gradient(96deg, var(--lightningcss-light, #9c28af) var(--lightningcss-dark, #e85bfd) 0%, var(--lightningcss-light, #6338ee) var(--lightningcss-dark, #8b8dfe) 66%, var(--lightningcss-light, #274dea) var(--lightningcss-dark, #6995fe) 100%);
271
271
  }
272
272
 
273
- ._B-u0nzys {
273
+ ._C-u0nzys {
274
274
  background-image: linear-gradient(96deg, var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e) 0%, var(--lightningcss-light, #d92361) var(--lightningcss-dark, #f37) 33%, var(--lightningcss-light, #7155fa) var(--lightningcss-dark, #8077fe) 100%);
275
275
  }
276
276
 
277
- ._B-1gcd5pl {
277
+ ._C-1gcd5pl {
278
278
  background-image: linear-gradient(96deg, var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756) 0%, var(--lightningcss-light, #ba1650) var(--lightningcss-dark, #ff6095) 33%, var(--lightningcss-light, #6338ee) var(--lightningcss-dark, #8b8dfe) 100%);
279
279
  }
280
280
 
281
- ._B-yknrp1 {
281
+ ._C-yknrp1 {
282
282
  background-image: none;
283
283
  }
284
284
 
@@ -290,11 +290,11 @@
290
290
  --iconPrimary: currentColor;
291
291
  }
292
292
 
293
- ._zb {
293
+ ._Ab {
294
294
  forced-color-adjust: none;
295
295
  }
296
296
 
297
- .__R-yksgrp {
297
+ .__S-yksgrp {
298
298
  -webkit-tap-highlight-color: #0000;
299
299
  }
300
300
 
@@ -334,6 +334,10 @@
334
334
  --v: 0px;
335
335
  }
336
336
 
337
+ .-_375toh_b-n {
338
+ --b: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
339
+ }
340
+
337
341
  .-_375toh_b-o {
338
342
  --b: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
339
343
  }
@@ -374,39 +378,35 @@
374
378
  --b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .14);
375
379
  }
376
380
 
377
- .-_375toh_b-n {
378
- --b: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
381
+ .-_375toh_b-a {
382
+ --b: transparent;
379
383
  }
380
384
 
381
385
  .-_375toh_b-_____x {
382
386
  --b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .11);
383
387
  }
384
388
 
385
- .-_375toh_b-a {
386
- --b: transparent;
387
- }
388
-
389
- .Ua {
389
+ .Va {
390
390
  position: absolute;
391
391
  }
392
392
 
393
- .X-3760fj {
393
+ .Y-3760fj {
394
394
  top: 50%;
395
395
  }
396
396
 
397
- .Y-3760fj {
397
+ .Z-3760fj {
398
398
  left: 50%;
399
399
  }
400
400
 
401
- .T-1tktoou {
401
+ .U-1tktoou {
402
402
  transform: translate(-50%, -50%);
403
403
  }
404
404
 
405
- ._K-3t1x {
405
+ ._L-3t1x {
406
406
  opacity: 0;
407
407
  }
408
408
 
409
- ._K-3t1y {
409
+ ._L-3t1y {
410
410
  opacity: 1;
411
411
  }
412
412
 
@@ -450,11 +450,11 @@
450
450
  padding-bottom: var(--labelPadding);
451
451
  }
452
452
 
453
- .__A-3t1y {
453
+ .__B-3t1y {
454
454
  order: 1;
455
455
  }
456
456
 
457
- .__A-3t1x {
457
+ .__B-3t1x {
458
458
  order: 0;
459
459
  }
460
460
 
@@ -470,21 +470,21 @@
470
470
  margin-inline-start: var(--iconMargin);
471
471
  }
472
472
 
473
- ._8-3t1x {
473
+ ._9-3t1x {
474
474
  flex-shrink: 0;
475
475
  }
476
476
  }
477
477
 
478
478
  @layer _.b {
479
- ._1-soocicc:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
479
+ ._2-soocicc:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
480
480
  align-items: center;
481
481
  }
482
482
 
483
- ._c-enzrfpb:lang(ar) {
483
+ ._d-enzrfpb:lang(ar) {
484
484
  font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;
485
485
  }
486
486
 
487
- ._f-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
487
+ ._g-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
488
488
  line-height: 1.5;
489
489
  }
490
490
 
@@ -516,7 +516,7 @@
516
516
  padding-inline-end: 0;
517
517
  }
518
518
 
519
- ._b-soocicb:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
519
+ ._c-soocicb:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
520
520
  aspect-ratio: 1;
521
521
  }
522
522
 
@@ -526,37 +526,37 @@
526
526
  }
527
527
 
528
528
  @layer _.c {
529
- ._c-enzwzjc:lang(he) {
529
+ ._d-enzwzjc:lang(he) {
530
530
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
531
531
  }
532
532
  }
533
533
 
534
534
  @layer _.d {
535
- ._c-enzykdd:lang(ja) {
535
+ ._d-enzykdd:lang(ja) {
536
536
  font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
537
537
  }
538
538
  }
539
539
 
540
540
  @layer _.e {
541
- ._c-enzzrge:lang(ko) {
541
+ ._d-enzzrge:lang(ko) {
542
542
  font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
543
543
  }
544
544
  }
545
545
 
546
546
  @layer _.f {
547
- ._c-eo0c6sf:lang(zh) {
547
+ ._d-eo0c6sf:lang(zh) {
548
548
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
549
549
  }
550
550
  }
551
551
 
552
552
  @layer _.g {
553
- ._c-1uotwbwg:lang(zh-hant) {
553
+ ._d-1uotwbwg:lang(zh-hant) {
554
554
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
555
555
  }
556
556
  }
557
557
 
558
558
  @layer _.h {
559
- ._c-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
559
+ ._d-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
560
560
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
561
561
  }
562
562
  }
@@ -597,7 +597,7 @@
597
597
  border-color: graytext;
598
598
  }
599
599
 
600
- ._Ba-yknrp1 {
600
+ ._Ca-yknrp1 {
601
601
  background-image: none;
602
602
  }
603
603
 
@@ -625,23 +625,23 @@
625
625
  column-gap: .470588em;
626
626
  }
627
627
 
628
- ._dbf {
628
+ ._ebf {
629
629
  font-size: 1.0625rem;
630
630
  }
631
631
 
632
- ._dbb {
632
+ ._ebb {
633
633
  font-size: .8125rem;
634
634
  }
635
635
 
636
- ._dbd {
636
+ ._ebd {
637
637
  font-size: .9375rem;
638
638
  }
639
639
 
640
- ._dbh {
640
+ ._ebh {
641
641
  font-size: 1.1875rem;
642
642
  }
643
643
 
644
- ._dbj {
644
+ ._ebj {
645
645
  font-size: 1.375rem;
646
646
  }
647
647
  }
@@ -1 +1 @@
1
- {"mappings":"ACmEe;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiTQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8CF;;;;EAAA;;;;EAAA;;;;EAKsC;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AApXL;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAsRK","sources":["47c518d02ef77298","packages/@react-spectrum/s2/src/Button.tsx"],"sourcesContent":["@import \"84fda4530d887d61\";\n@import \"58029840d81c849c\";\n@import \"741c49b4968f5e00\";\n@import \"d2d5d6a0faea83be\";\n@import \"7420f4e12e7ef59c\";\n@import \"b849e4ca63c3cc49\";\n@import \"36ff0e1e9ec0e357\";\n@import \"5ed629d4d0b8048c\";\n@import \"341672feb3593eb4\";\n","/*\n * Copyright 2024 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 {baseColor, focusRing, fontRelative, linearGradient, style} from '../style' with {type: 'macro'};\nimport {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonStyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button.\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'accent' | 'negative' | 'premium' | 'genai',\n /**\n * The background style of the Button.\n *\n * @default 'fill'\n */\n fillStyle?: 'fill' | 'outline',\n /**\n * The size of the Button.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the Button appears over a color background. */\n staticColor?: 'white' | 'black' | 'auto'\n}\n\nexport interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);\nexport const LinkButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLAnchorElement>>>(null);\n\nconst iconOnly = ':has([slot=icon]):not(:has([data-rsp-slot=text]))';\nconst button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n position: 'relative',\n display: 'flex',\n alignItems: {\n default: 'baseline',\n [iconOnly]: 'center'\n },\n justifyContent: 'center',\n textAlign: 'start',\n columnGap: 'text-to-visual',\n font: 'control',\n fontWeight: 'bold',\n userSelect: 'none',\n minHeight: 'control',\n minWidth: {\n [iconOnly]: 'control'\n },\n borderRadius: 'pill',\n boxSizing: 'border-box',\n width: 'fit',\n textDecoration: 'none', // for link buttons\n paddingX: {\n default: 'pill',\n [iconOnly]: 0\n },\n paddingY: 0,\n aspectRatio: {\n [iconOnly]: 'square'\n },\n transition: 'default',\n borderStyle: 'solid',\n borderWidth: {\n fillStyle: {\n fill: 0,\n outline: 2\n },\n variant: {\n premium: 0,\n genai: 0\n }\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n borderColor: {\n variant: {\n primary: baseColor('gray-800'),\n secondary: baseColor('gray-300')\n },\n isDisabled: 'disabled',\n isStaticColor: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-300')\n },\n isDisabled: 'transparent-overlay-300'\n },\n forcedColors: {\n default: 'ButtonBorder',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n backgroundImage: {\n variant: {\n premium: {\n default: linearGradient('96deg', ['fuchsia-900', 0], ['indigo-900', 66], ['blue-900', 100]),\n isHovered: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isPressed: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100])\n },\n genai: {\n default: linearGradient('96deg', ['red-900', 0], ['magenta-900', 33], ['indigo-900', 100]),\n isHovered: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isPressed: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100])\n }\n },\n isDisabled: 'none',\n isPending: 'none',\n forcedColors: 'none'\n },\n backgroundColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'neutral',\n secondary: baseColor('gray-100'),\n accent: 'accent',\n negative: 'negative',\n premium: 'gray-100',\n genai: 'gray-100'\n },\n isDisabled: 'disabled'\n },\n outline: {\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n },\n default: 'transparent',\n isHovered: 'gray-100',\n isPressed: 'gray-100',\n isFocusVisible: 'gray-100',\n isDisabled: 'transparent'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-100'),\n premium: 'gray-800',\n genai: 'gray-800'\n },\n isDisabled: 'transparent-overlay-100'\n },\n outline: {\n variant: {\n premium: 'gray-800',\n genai: 'gray-800'\n },\n default: 'transparent',\n isHovered: 'transparent-overlay-100',\n isPressed: 'transparent-overlay-100',\n isFocusVisible: 'transparent-overlay-100',\n isDisabled: 'transparent'\n }\n }\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n },\n outline: 'ButtonFace'\n }\n }\n },\n color: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'gray-25',\n secondary: 'neutral',\n accent: 'white',\n negative: 'white',\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n variant: {\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'auto',\n secondary: baseColor('transparent-overlay-800'),\n premium: 'white',\n genai: 'white'\n }\n },\n outline: {\n variant: {\n premium: 'white',\n genai: 'white'\n },\n default: baseColor('transparent-overlay-800')\n }\n },\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonFace',\n isDisabled: 'HighlightText'\n },\n outline: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n forcedColorAdjust: 'none',\n disableTapHighlight: true\n}, getAllowedOverrides());\n\n/**\n * Buttons allow users to perform an action.\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 */\nexport const Button = forwardRef(function Button(props: ButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonContext);\n props = useFormProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isPending,\n variant = 'primary',\n fillStyle = 'fill',\n size = 'M',\n staticColor\n } = props;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n let [isProgressVisible, setIsProgressVisible] = useState(false);\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 return (\n <RACButton\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n variant,\n fillStyle,\n size,\n staticColor,\n isStaticColor: !!staticColor\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({\n paddingY: '--labelPadding',\n order: 1,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n flexShrink: 0,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n {isPending &&\n <div\n className={style({\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translate(-50%, -50%)',\n opacity: {\n default: 0,\n isProgressVisible: 1\n }\n })({isProgressVisible, isPending})}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('button.pending')}\n size=\"S\"\n staticColor={staticColor}\n styles={style({\n size: {\n size: {\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})} />\n </div>\n }\n </Provider>\n </RACButton>\n );\n});\n\n/**\n * A LinkButton combines the functionality of a link with the appearance of a button. Useful for allowing users to navigate to another page.\n */\nexport const LinkButton = forwardRef(function LinkButton(props: LinkButtonProps, ref: FocusableRef<HTMLAnchorElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, LinkButtonContext);\n props = useFormProps(props);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n return (\n <Link\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n variant: props.variant || 'primary',\n fillStyle: props.fillStyle || 'fill',\n size: props.size || 'M',\n staticColor: props.staticColor,\n isStaticColor: !!props.staticColor,\n isPending: false\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({paddingY: '--labelPadding', order: 1}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </Link>\n );\n});\n"],"names":[],"version":3,"file":"Button.css.map"}
1
+ {"mappings":"ACmEe;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA4TQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8CF;;;;EAAA;;;;EAAA;;;;EAKsC;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA/XL;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAiSK","sources":["47c518d02ef77298","packages/@react-spectrum/s2/src/Button.tsx"],"sourcesContent":["@import \"84fda4530d887d61\";\n@import \"58029840d81c849c\";\n@import \"741c49b4968f5e00\";\n@import \"d2d5d6a0faea83be\";\n@import \"7420f4e12e7ef59c\";\n@import \"b849e4ca63c3cc49\";\n@import \"36ff0e1e9ec0e357\";\n@import \"5ed629d4d0b8048c\";\n@import \"341672feb3593eb4\";\n","/*\n * Copyright 2024 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 {baseColor, focusRing, fontRelative, linearGradient, style} from '../style' with {type: 'macro'};\nimport {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonStyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button.\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'accent' | 'negative' | 'premium' | 'genai',\n /**\n * The background style of the Button.\n *\n * @default 'fill'\n */\n fillStyle?: 'fill' | 'outline',\n /**\n * The size of the Button.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the Button appears over a color background. */\n staticColor?: 'white' | 'black' | 'auto'\n}\n\nexport interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);\nexport const LinkButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLAnchorElement>>>(null);\n\nconst iconOnly = ':has([slot=icon]):not(:has([data-rsp-slot=text]))';\nconst button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n position: 'relative',\n display: 'flex',\n alignItems: {\n default: 'baseline',\n [iconOnly]: 'center'\n },\n justifyContent: 'center',\n textAlign: 'start',\n columnGap: 'text-to-visual',\n font: 'control',\n fontWeight: 'bold',\n userSelect: 'none',\n minHeight: 'control',\n minWidth: {\n [iconOnly]: 'control'\n },\n borderRadius: 'pill',\n boxSizing: 'border-box',\n width: 'fit',\n textDecoration: 'none', // for link buttons\n paddingX: {\n default: 'pill',\n [iconOnly]: 0\n },\n paddingY: 0,\n aspectRatio: {\n [iconOnly]: 'square'\n },\n transition: 'default',\n borderStyle: 'solid',\n borderWidth: {\n fillStyle: {\n fill: 0,\n outline: 2\n },\n variant: {\n premium: 0,\n genai: 0\n }\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n borderColor: {\n variant: {\n primary: baseColor('gray-800'),\n secondary: baseColor('gray-300')\n },\n isDisabled: 'disabled',\n isStaticColor: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-300')\n },\n isDisabled: 'transparent-overlay-300'\n },\n forcedColors: {\n default: 'ButtonBorder',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n backgroundImage: {\n variant: {\n premium: {\n default: linearGradient('96deg', ['fuchsia-900', 0], ['indigo-900', 66], ['blue-900', 100]),\n isHovered: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isPressed: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100])\n },\n genai: {\n default: linearGradient('96deg', ['red-900', 0], ['magenta-900', 33], ['indigo-900', 100]),\n isHovered: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isPressed: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100])\n }\n },\n isDisabled: 'none',\n forcedColors: 'none'\n },\n backgroundColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'neutral',\n secondary: baseColor('gray-100'),\n accent: 'accent',\n negative: 'negative',\n premium: 'gray-100',\n genai: 'gray-100'\n },\n isDisabled: 'disabled'\n },\n outline: {\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n },\n default: 'transparent',\n isHovered: 'gray-100',\n isPressed: 'gray-100',\n isFocusVisible: 'gray-100',\n isDisabled: {\n default: 'transparent',\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n }\n }\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-100'),\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n },\n isDisabled: 'transparent-overlay-100'\n },\n outline: {\n variant: {\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n },\n default: 'transparent',\n isHovered: 'transparent-overlay-100',\n isPressed: 'transparent-overlay-100',\n isFocusVisible: 'transparent-overlay-100',\n isDisabled: {\n default: 'transparent',\n variant: {\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n }\n }\n }\n }\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n },\n outline: 'ButtonFace'\n }\n }\n },\n color: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'gray-25',\n secondary: 'neutral',\n accent: 'white',\n negative: 'white',\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n variant: {\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'auto',\n secondary: baseColor('transparent-overlay-800'),\n premium: 'white',\n genai: 'white'\n }\n },\n outline: {\n variant: {\n premium: 'white',\n genai: 'white'\n },\n default: baseColor('transparent-overlay-800')\n }\n },\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonFace',\n isDisabled: 'HighlightText'\n },\n outline: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n forcedColorAdjust: 'none',\n disableTapHighlight: true\n}, getAllowedOverrides());\n\n/**\n * Buttons allow users to perform an action.\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 */\nexport const Button = forwardRef(function Button(props: ButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonContext);\n props = useFormProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isPending,\n variant = 'primary',\n fillStyle = 'fill',\n size = 'M',\n staticColor\n } = props;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n let [isProgressVisible, setIsProgressVisible] = useState(false);\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 return (\n <RACButton\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n variant,\n fillStyle,\n size,\n staticColor,\n isStaticColor: !!staticColor\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({\n paddingY: '--labelPadding',\n order: 1,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n flexShrink: 0,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n {isPending &&\n <div\n className={style({\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translate(-50%, -50%)',\n opacity: {\n default: 0,\n isProgressVisible: 1\n }\n })({isProgressVisible, isPending})}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('button.pending')}\n size=\"S\"\n staticColor={staticColor}\n styles={style({\n size: {\n size: {\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})} />\n </div>\n }\n </Provider>\n </RACButton>\n );\n});\n\n/**\n * A LinkButton combines the functionality of a link with the appearance of a button. Useful for allowing users to navigate to another page.\n */\nexport const LinkButton = forwardRef(function LinkButton(props: LinkButtonProps, ref: FocusableRef<HTMLAnchorElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, LinkButtonContext);\n props = useFormProps(props);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n return (\n <Link\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n variant: props.variant || 'primary',\n fillStyle: props.fillStyle || 'fill',\n size: props.size || 'M',\n staticColor: props.staticColor,\n isStaticColor: !!props.staticColor,\n isPending: false\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({paddingY: '--labelPadding', order: 1}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </Link>\n );\n});\n"],"names":[],"version":3,"file":"Button.css.map"}