@react-spectrum/s2 3.0.0-nightly-e7053dd8f-250108 → 3.0.0-nightly-e4497fdb6-250110

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 (227) 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 +57 -57
  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 +66 -60
  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 +179 -144
  29. package/dist/Button.cjs.map +1 -1
  30. package/dist/Button.css +167 -86
  31. package/dist/Button.css.map +1 -1
  32. package/dist/Button.mjs +180 -145
  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 +163 -163
  38. package/dist/Card.css +118 -118
  39. package/dist/Card.mjs +163 -163
  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 +44 -44
  48. package/dist/Checkbox.mjs +46 -46
  49. package/dist/CheckboxGroup.cjs +39 -39
  50. package/dist/CheckboxGroup.css +32 -32
  51. package/dist/CheckboxGroup.mjs +39 -39
  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 +17 -15
  56. package/dist/CloseButton.cjs.map +1 -1
  57. package/dist/CloseButton.css +24 -16
  58. package/dist/CloseButton.css.map +1 -1
  59. package/dist/CloseButton.mjs +17 -15
  60. package/dist/CloseButton.mjs.map +1 -1
  61. package/dist/ColorArea.cjs +9 -9
  62. package/dist/ColorArea.css +9 -9
  63. package/dist/ColorArea.mjs +9 -9
  64. package/dist/ColorField.cjs +29 -29
  65. package/dist/ColorField.css +24 -24
  66. package/dist/ColorField.mjs +29 -29
  67. package/dist/ColorHandle.cjs +9 -9
  68. package/dist/ColorHandle.css +16 -16
  69. package/dist/ColorHandle.mjs +9 -9
  70. package/dist/ColorSlider.cjs +40 -40
  71. package/dist/ColorSlider.css +42 -42
  72. package/dist/ColorSlider.mjs +40 -40
  73. package/dist/ColorSwatch.cjs +6 -6
  74. package/dist/ColorSwatch.css +14 -14
  75. package/dist/ColorSwatch.mjs +6 -6
  76. package/dist/ColorSwatchPicker.cjs +12 -12
  77. package/dist/ColorSwatchPicker.css +32 -32
  78. package/dist/ColorSwatchPicker.mjs +12 -12
  79. package/dist/ColorWheel.cjs +14 -14
  80. package/dist/ColorWheel.css +14 -14
  81. package/dist/ColorWheel.mjs +14 -14
  82. package/dist/ComboBox.cjs +54 -51
  83. package/dist/ComboBox.cjs.map +1 -1
  84. package/dist/ComboBox.css +48 -48
  85. package/dist/ComboBox.css.map +1 -1
  86. package/dist/ComboBox.mjs +54 -51
  87. package/dist/ComboBox.mjs.map +1 -1
  88. package/dist/ContextualHelp.cjs +5 -5
  89. package/dist/ContextualHelp.css +23 -23
  90. package/dist/ContextualHelp.mjs +5 -5
  91. package/dist/CustomDialog.cjs +8 -8
  92. package/dist/CustomDialog.css +9 -9
  93. package/dist/CustomDialog.mjs +8 -8
  94. package/dist/Dialog.cjs +10 -10
  95. package/dist/Dialog.css +39 -39
  96. package/dist/Dialog.mjs +10 -10
  97. package/dist/Disclosure.cjs +53 -53
  98. package/dist/Disclosure.css +48 -48
  99. package/dist/Disclosure.mjs +53 -53
  100. package/dist/Divider.cjs +5 -5
  101. package/dist/Divider.css +5 -5
  102. package/dist/Divider.mjs +5 -5
  103. package/dist/DropZone.cjs +24 -24
  104. package/dist/DropZone.css +24 -24
  105. package/dist/DropZone.mjs +24 -24
  106. package/dist/Field.cjs +107 -107
  107. package/dist/Field.cjs.map +1 -1
  108. package/dist/Field.css +69 -69
  109. package/dist/Field.mjs +107 -107
  110. package/dist/Field.mjs.map +1 -1
  111. package/dist/Form.cjs +4 -4
  112. package/dist/Form.css +3 -3
  113. package/dist/Form.mjs +4 -4
  114. package/dist/FullscreenDialog.cjs +5 -5
  115. package/dist/FullscreenDialog.css +54 -54
  116. package/dist/FullscreenDialog.mjs +5 -5
  117. package/dist/IllustratedMessage.cjs +126 -126
  118. package/dist/IllustratedMessage.css +58 -58
  119. package/dist/IllustratedMessage.mjs +126 -126
  120. package/dist/Image.cjs +10 -10
  121. package/dist/Image.css +11 -11
  122. package/dist/Image.mjs +10 -10
  123. package/dist/InlineAlert.cjs +50 -50
  124. package/dist/InlineAlert.css +44 -44
  125. package/dist/InlineAlert.mjs +50 -50
  126. package/dist/Link.cjs +27 -27
  127. package/dist/Link.css +28 -28
  128. package/dist/Link.mjs +27 -27
  129. package/dist/Menu.cjs +292 -221
  130. package/dist/Menu.cjs.map +1 -1
  131. package/dist/Menu.css +115 -113
  132. package/dist/Menu.css.map +1 -1
  133. package/dist/Menu.mjs +292 -221
  134. package/dist/Menu.mjs.map +1 -1
  135. package/dist/Meter.cjs +51 -51
  136. package/dist/Meter.css +51 -51
  137. package/dist/Meter.mjs +51 -51
  138. package/dist/Modal.cjs +37 -37
  139. package/dist/Modal.css +35 -35
  140. package/dist/Modal.mjs +37 -37
  141. package/dist/NumberField.cjs +60 -60
  142. package/dist/NumberField.css +66 -66
  143. package/dist/NumberField.mjs +60 -60
  144. package/dist/Picker.cjs +117 -114
  145. package/dist/Picker.cjs.map +1 -1
  146. package/dist/Picker.css +80 -80
  147. package/dist/Picker.css.map +1 -1
  148. package/dist/Picker.mjs +117 -114
  149. package/dist/Picker.mjs.map +1 -1
  150. package/dist/Popover.cjs +40 -40
  151. package/dist/Popover.css +37 -37
  152. package/dist/Popover.mjs +40 -40
  153. package/dist/ProgressBar.cjs +63 -63
  154. package/dist/ProgressBar.css +61 -61
  155. package/dist/ProgressBar.mjs +63 -63
  156. package/dist/ProgressCircle.cjs +3 -3
  157. package/dist/ProgressCircle.css +2 -2
  158. package/dist/ProgressCircle.mjs +3 -3
  159. package/dist/Provider.cjs +4 -4
  160. package/dist/Provider.css +5 -5
  161. package/dist/Provider.mjs +4 -4
  162. package/dist/Radio.cjs +46 -46
  163. package/dist/Radio.css +44 -44
  164. package/dist/Radio.mjs +46 -46
  165. package/dist/RadioGroup.cjs +37 -37
  166. package/dist/RadioGroup.css +32 -32
  167. package/dist/RadioGroup.mjs +37 -37
  168. package/dist/SearchField.cjs +31 -31
  169. package/dist/SearchField.css +29 -29
  170. package/dist/SearchField.mjs +31 -31
  171. package/dist/SegmentedControl.cjs +54 -54
  172. package/dist/SegmentedControl.css +55 -55
  173. package/dist/SegmentedControl.mjs +54 -54
  174. package/dist/Slider.cjs +101 -101
  175. package/dist/Slider.css +82 -82
  176. package/dist/Slider.mjs +101 -101
  177. package/dist/StatusLight.cjs +26 -26
  178. package/dist/StatusLight.css +26 -26
  179. package/dist/StatusLight.mjs +26 -26
  180. package/dist/Switch.cjs +47 -47
  181. package/dist/Switch.css +42 -42
  182. package/dist/Switch.mjs +47 -47
  183. package/dist/TableView.cjs +137 -137
  184. package/dist/TableView.css +76 -76
  185. package/dist/TableView.mjs +137 -137
  186. package/dist/Tabs.cjs +60 -60
  187. package/dist/Tabs.css +53 -53
  188. package/dist/Tabs.mjs +60 -60
  189. package/dist/TabsPicker.cjs +69 -69
  190. package/dist/TabsPicker.css +62 -62
  191. package/dist/TabsPicker.mjs +69 -69
  192. package/dist/TagGroup.cjs +108 -108
  193. package/dist/TagGroup.css +85 -85
  194. package/dist/TagGroup.mjs +108 -108
  195. package/dist/TextField.cjs +36 -36
  196. package/dist/TextField.css +33 -33
  197. package/dist/TextField.mjs +36 -36
  198. package/dist/ToggleButton.cjs +3 -3
  199. package/dist/ToggleButton.css +7 -7
  200. package/dist/ToggleButton.mjs +3 -3
  201. package/dist/Tooltip.cjs +32 -32
  202. package/dist/Tooltip.css +34 -34
  203. package/dist/Tooltip.mjs +32 -32
  204. package/dist/types.d.ts +2 -0
  205. package/dist/types.d.ts.map +1 -1
  206. package/icons/Skeleton.cjs +2 -2
  207. package/icons/Skeleton.css +5 -5
  208. package/icons/Skeleton.mjs +2 -2
  209. package/package.json +19 -19
  210. package/src/Button.tsx +107 -75
  211. package/src/CloseButton.tsx +4 -0
  212. package/src/ComboBox.tsx +2 -1
  213. package/src/Menu.tsx +40 -17
  214. package/src/Picker.tsx +2 -1
  215. package/style/dist/spectrum-theme.cjs +54 -5
  216. package/style/dist/spectrum-theme.cjs.map +1 -1
  217. package/style/dist/spectrum-theme.mjs +54 -5
  218. package/style/dist/spectrum-theme.mjs.map +1 -1
  219. package/style/dist/style-macro.cjs +1 -1
  220. package/style/dist/style-macro.cjs.map +1 -1
  221. package/style/dist/style-macro.mjs +1 -1
  222. package/style/dist/style-macro.mjs.map +1 -1
  223. package/style/dist/types.d.ts +10 -3
  224. package/style/dist/types.d.ts.map +1 -1
  225. package/style/spectrum-theme.ts +66 -7
  226. package/style/style-macro.ts +3 -3
  227. package/style/types.ts +1 -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,18 +178,6 @@
178
178
  padding-bottom: 0;
179
179
  }
180
180
 
181
- ._Oa {
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
- }
184
-
185
- ._Q-375x7f {
186
- transition-duration: .15s;
187
- }
188
-
189
- ._Ra {
190
- transition-timing-function: cubic-bezier(.45, 0, .4, 1);
191
- }
192
-
193
181
  .wa {
194
182
  border-style: solid;
195
183
  }
@@ -262,26 +250,6 @@
262
250
  border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .17);
263
251
  }
264
252
 
265
- ._B-riuwfd {
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
- }
268
-
269
- ._B-2xhv0x {
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
- }
272
-
273
- ._B-u0nzys {
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
- }
276
-
277
- ._B-1gcd5pl {
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
- }
280
-
281
- ._B-yknrp1 {
282
- background-image: none;
283
- }
284
-
285
253
  .b-375toh {
286
254
  background-color: var(--b);
287
255
  }
@@ -290,11 +258,11 @@
290
258
  --iconPrimary: currentColor;
291
259
  }
292
260
 
293
- ._zb {
261
+ ._Ab {
294
262
  forced-color-adjust: none;
295
263
  }
296
264
 
297
- .__R-yksgrp {
265
+ .__S-yksgrp {
298
266
  -webkit-tap-highlight-color: #0000;
299
267
  }
300
268
 
@@ -386,27 +354,122 @@
386
354
  --b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .11);
387
355
  }
388
356
 
389
- .Ua {
357
+ .Ya {
358
+ top: 0;
359
+ }
360
+
361
+ ._aa {
362
+ bottom: 0;
363
+ }
364
+
365
+ .Wa {
366
+ inset-inline-start: 0;
367
+ }
368
+
369
+ .Xa {
370
+ inset-inline-end: 0;
371
+ }
372
+
373
+ .__R-3hmpv {
374
+ z-index: -1;
375
+ }
376
+
377
+ ._Pa {
378
+ transition-property: color, background-color, var(--gp), border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter;
379
+ }
380
+
381
+ ._R-375x7f {
382
+ transition-duration: .15s;
383
+ }
384
+
385
+ ._Sa {
386
+ transition-timing-function: cubic-bezier(.45, 0, .4, 1);
387
+ }
388
+
389
+ ._w-17zqamw {
390
+ border-start-start-radius: inherit;
391
+ }
392
+
393
+ ._x-17zqamw {
394
+ border-start-end-radius: inherit;
395
+ }
396
+
397
+ ._y-17zqamw {
398
+ border-end-start-radius: inherit;
399
+ }
400
+
401
+ ._z-17zqamw {
402
+ border-end-end-radius: inherit;
403
+ }
404
+
405
+ ._C-1bwg29 {
406
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 66%, var(--g2) 100%);
407
+ --g0: var(--lightningcss-light, #b539c8) var(--lightningcss-dark, #d549eb);
408
+ --g1: var(--lightningcss-light, #7155fa) var(--lightningcss-dark, #8077fe);
409
+ --g2: var(--lightningcss-light, #3b63fb) var(--lightningcss-dark, #5681ff);
410
+ --gp: --g0, --g1, --g2;
411
+ }
412
+
413
+ ._C-zh0yy1 {
414
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 66%, var(--g2) 100%);
415
+ --g0: var(--lightningcss-light, #9c28af) var(--lightningcss-dark, #e85bfd);
416
+ --g1: var(--lightningcss-light, #6338ee) var(--lightningcss-dark, #8b8dfe);
417
+ --g2: var(--lightningcss-light, #274dea) var(--lightningcss-dark, #6995fe);
418
+ --gp: --g0, --g1, --g2;
419
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 66%, var(--g2) 100%);
420
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 66%, var(--g2) 100%);
421
+ }
422
+
423
+ ._C-17z6g7s {
424
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 33%, var(--g2) 100%);
425
+ --g0: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
426
+ --g1: var(--lightningcss-light, #d92361) var(--lightningcss-dark, #f37);
427
+ --g2: var(--lightningcss-light, #7155fa) var(--lightningcss-dark, #8077fe);
428
+ --gp: --g0, --g1, --g2;
429
+ }
430
+
431
+ ._C-x40uwg {
432
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 33%, var(--g2) 100%);
433
+ --g0: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
434
+ --g1: var(--lightningcss-light, #ba1650) var(--lightningcss-dark, #ff6095);
435
+ --g2: var(--lightningcss-light, #6338ee) var(--lightningcss-dark, #8b8dfe);
436
+ --gp: --g0, --g1, --g2;
437
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 33%, var(--g2) 100%);
438
+ background-image: linear-gradient(to bottom right, var(--g0) 0%, var(--g1) 33%, var(--g2) 100%);
439
+ }
440
+
441
+ ._C-qey189 {
442
+ background-image: none;
443
+ }
444
+
445
+ ._Ba {
446
+ --lightningcss-light: initial;
447
+ --lightningcss-dark: ;
448
+ color-scheme: light;
449
+ color-scheme: light;
450
+ }
451
+
452
+ .Va {
390
453
  position: absolute;
391
454
  }
392
455
 
393
- .X-3760fj {
456
+ .Y-3760fj {
394
457
  top: 50%;
395
458
  }
396
459
 
397
- .Y-3760fj {
460
+ .Z-3760fj {
398
461
  left: 50%;
399
462
  }
400
463
 
401
- .T-1tktoou {
464
+ .U-1uu3e5e {
402
465
  transform: translate(-50%, -50%);
403
466
  }
404
467
 
405
- ._K-3t1x {
468
+ ._L-3t1x {
406
469
  opacity: 0;
407
470
  }
408
471
 
409
- ._K-3t1y {
472
+ ._L-3t1y {
410
473
  opacity: 1;
411
474
  }
412
475
 
@@ -450,11 +513,11 @@
450
513
  padding-bottom: var(--labelPadding);
451
514
  }
452
515
 
453
- .__A-3t1y {
516
+ .__B-3t1y {
454
517
  order: 1;
455
518
  }
456
519
 
457
- .__A-3t1x {
520
+ .__B-3t1x {
458
521
  order: 0;
459
522
  }
460
523
 
@@ -470,21 +533,21 @@
470
533
  margin-inline-start: var(--iconMargin);
471
534
  }
472
535
 
473
- ._8-3t1x {
536
+ ._9-3t1x {
474
537
  flex-shrink: 0;
475
538
  }
476
539
  }
477
540
 
478
541
  @layer _.b {
479
- ._1-soocicc:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
542
+ ._2-soocicc:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
480
543
  align-items: center;
481
544
  }
482
545
 
483
- ._c-enzrfpb:lang(ar) {
546
+ ._d-enzrfpb:lang(ar) {
484
547
  font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;
485
548
  }
486
549
 
487
- ._f-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
550
+ ._g-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
488
551
  line-height: 1.5;
489
552
  }
490
553
 
@@ -516,7 +579,7 @@
516
579
  padding-inline-end: 0;
517
580
  }
518
581
 
519
- ._b-soocicb:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
582
+ ._c-soocicb:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
520
583
  aspect-ratio: 1;
521
584
  }
522
585
 
@@ -526,37 +589,37 @@
526
589
  }
527
590
 
528
591
  @layer _.c {
529
- ._c-enzwzjc:lang(he) {
592
+ ._d-enzwzjc:lang(he) {
530
593
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
531
594
  }
532
595
  }
533
596
 
534
597
  @layer _.d {
535
- ._c-enzykdd:lang(ja) {
598
+ ._d-enzykdd:lang(ja) {
536
599
  font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
537
600
  }
538
601
  }
539
602
 
540
603
  @layer _.e {
541
- ._c-enzzrge:lang(ko) {
604
+ ._d-enzzrge:lang(ko) {
542
605
  font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
543
606
  }
544
607
  }
545
608
 
546
609
  @layer _.f {
547
- ._c-eo0c6sf:lang(zh) {
610
+ ._d-eo0c6sf:lang(zh) {
548
611
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
549
612
  }
550
613
  }
551
614
 
552
615
  @layer _.g {
553
- ._c-1uotwbwg:lang(zh-hant) {
616
+ ._d-1uotwbwg:lang(zh-hant) {
554
617
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
555
618
  }
556
619
  }
557
620
 
558
621
  @layer _.h {
559
- ._c-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
622
+ ._d-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
560
623
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
561
624
  }
562
625
  }
@@ -597,10 +660,6 @@
597
660
  border-color: graytext;
598
661
  }
599
662
 
600
- ._Ba-yknrp1 {
601
- background-image: none;
602
- }
603
-
604
663
  .-_375toh_b-a_____K {
605
664
  --b: ButtonText;
606
665
  }
@@ -616,6 +675,10 @@
616
675
  .-_375toh_b-a_____J {
617
676
  --b: ButtonFace;
618
677
  }
678
+
679
+ ._Ca-qey189 {
680
+ background-image: none;
681
+ }
619
682
  }
620
683
  }
621
684
 
@@ -625,28 +688,46 @@
625
688
  column-gap: .470588em;
626
689
  }
627
690
 
628
- ._dbf {
691
+ ._ebf {
629
692
  font-size: 1.0625rem;
630
693
  }
631
694
 
632
- ._dbb {
695
+ ._ebb {
633
696
  font-size: .8125rem;
634
697
  }
635
698
 
636
- ._dbd {
699
+ ._ebd {
637
700
  font-size: .9375rem;
638
701
  }
639
702
 
640
- ._dbh {
703
+ ._ebh {
641
704
  font-size: 1.1875rem;
642
705
  }
643
706
 
644
- ._dbj {
707
+ ._ebj {
645
708
  font-size: 1.375rem;
646
709
  }
647
710
  }
648
711
  }
649
712
 
713
+ @property --g0 {
714
+ syntax: "<color>";
715
+ inherits: false;
716
+ initial-value: #0000;
717
+ }
718
+
719
+ @property --g1 {
720
+ syntax: "<color>";
721
+ inherits: false;
722
+ initial-value: #0000;
723
+ }
724
+
725
+ @property --g2 {
726
+ syntax: "<color>";
727
+ inherits: false;
728
+ initial-value: #0000;
729
+ }
730
+
650
731
  .\.:not(#a#b) {
651
732
  all: revert-layer;
652
733
  }
@@ -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;;;;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"}
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;;;;EAwNE;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;;;EAAA;;;;;;;;;;EAAA;;;;;;;;EAAA;;;;;;;;;;EAAA;;;;EAAA;;;;;;;EAmIQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA+CJ;;;;EAAA;;;;EAAA;;;;EAKsC;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA/ZL;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;;;;IAwNE;;;;;;AAxNF;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AA0OS;;;;;;AAAA;;;;;;AAAA;;;;;;AAlBP","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@import \"e68e1721c6627faa\";\n@import \"42efd4ec8049a799\";\n@import \"95ab9abea37ea72d\";\n@import \"8b2fc5f468b9d46d\";\n@import \"52b2e217b498e7a2\";\n@import \"9ea4c114cf8bdeec\";\n@import \"ab8478361150f3f7\";\n@import \"981e6619126f3569\";\n@import \"bcbcf345b1725911\";\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 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// Put the gradient background on a separate element from the button to work around a Safari\n// bug where transitions of custom properties cause layout flickering if any properties use rems. 🤣\n// https://bugs.webkit.org/show_bug.cgi?id=285622\nconst gradient = style({\n position: 'absolute',\n inset: 0,\n zIndex: -1,\n transition: 'default',\n borderRadius: '[inherit]',\n backgroundImage: {\n variant: {\n premium: {\n default: linearGradient('to bottom right', ['fuchsia-900', 0], ['indigo-900', 66], ['blue-900', 100]),\n isHovered: linearGradient('to bottom right', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isPressed: linearGradient('to bottom right', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isFocusVisible: linearGradient('to bottom right', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100])\n },\n genai: {\n default: linearGradient('to bottom right', ['red-900', 0], ['magenta-900', 33], ['indigo-900', 100]),\n isHovered: linearGradient('to bottom right', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isPressed: linearGradient('to bottom right', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isFocusVisible: linearGradient('to bottom right', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100])\n }\n },\n isDisabled: 'none',\n forcedColors: 'none'\n },\n // Force gradient colors to remain static between light and dark theme.\n colorScheme: {\n variant: {\n premium: 'light',\n genai: 'light'\n }\n }\n});\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 {(renderProps) => (<>\n {variant === 'genai' || variant === 'premium' \n ? (\n <span\n className={gradient({\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 })} />\n )\n : null}\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 </>)}\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"}