@react-spectrum/s2 3.0.0-nightly-326f48154-241216 → 3.0.0-nightly-adae13c78-241218

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 (184) hide show
  1. package/dist/ActionButton.cjs +58 -80
  2. package/dist/ActionButton.cjs.map +1 -1
  3. package/dist/ActionButton.css +76 -96
  4. package/dist/ActionButton.css.map +1 -1
  5. package/dist/ActionButton.mjs +58 -80
  6. package/dist/ActionButton.mjs.map +1 -1
  7. package/dist/ActionButtonGroup.cjs.map +1 -1
  8. package/dist/ActionButtonGroup.css.map +1 -1
  9. package/dist/ActionButtonGroup.mjs.map +1 -1
  10. package/dist/Badge.cjs +66 -66
  11. package/dist/Badge.css +43 -43
  12. package/dist/Badge.mjs +66 -66
  13. package/dist/Breadcrumbs.cjs +6 -6
  14. package/dist/Breadcrumbs.css +4 -4
  15. package/dist/Breadcrumbs.mjs +6 -6
  16. package/dist/Button.cjs +89 -134
  17. package/dist/Button.cjs.map +1 -1
  18. package/dist/Button.css +102 -134
  19. package/dist/Button.css.map +1 -1
  20. package/dist/Button.mjs +89 -134
  21. package/dist/Button.mjs.map +1 -1
  22. package/dist/Card.cjs +4 -4
  23. package/dist/Card.css +3 -3
  24. package/dist/Card.mjs +4 -4
  25. package/dist/CardView.cjs +1 -1
  26. package/dist/CardView.css +1 -1
  27. package/dist/CardView.mjs +1 -1
  28. package/dist/Checkbox.cjs +10 -10
  29. package/dist/Checkbox.css +10 -10
  30. package/dist/Checkbox.mjs +10 -10
  31. package/dist/CloseButton.cjs +17 -28
  32. package/dist/CloseButton.cjs.map +1 -1
  33. package/dist/CloseButton.css +19 -31
  34. package/dist/CloseButton.css.map +1 -1
  35. package/dist/CloseButton.mjs +17 -28
  36. package/dist/CloseButton.mjs.map +1 -1
  37. package/dist/ColorArea.cjs +1 -1
  38. package/dist/ColorArea.css +1 -1
  39. package/dist/ColorArea.mjs +1 -1
  40. package/dist/ColorHandle.cjs +3 -3
  41. package/dist/ColorHandle.css +3 -3
  42. package/dist/ColorHandle.mjs +3 -3
  43. package/dist/ColorSlider.cjs +1 -1
  44. package/dist/ColorSlider.css +1 -1
  45. package/dist/ColorSlider.mjs +1 -1
  46. package/dist/ColorSwatchPicker.cjs +1 -1
  47. package/dist/ColorSwatchPicker.css +1 -1
  48. package/dist/ColorSwatchPicker.mjs +1 -1
  49. package/dist/ColorWheel.cjs +2 -2
  50. package/dist/ColorWheel.css +1 -1
  51. package/dist/ColorWheel.mjs +2 -2
  52. package/dist/ComboBox.cjs +5 -5
  53. package/dist/ComboBox.css +4 -4
  54. package/dist/ComboBox.mjs +5 -5
  55. package/dist/Disclosure.cjs +1 -1
  56. package/dist/Disclosure.css +1 -1
  57. package/dist/Disclosure.mjs +1 -1
  58. package/dist/Divider.cjs +8 -8
  59. package/dist/Divider.cjs.map +1 -1
  60. package/dist/Divider.css +13 -13
  61. package/dist/Divider.css.map +1 -1
  62. package/dist/Divider.mjs +8 -8
  63. package/dist/Divider.mjs.map +1 -1
  64. package/dist/DropZone.cjs +4 -4
  65. package/dist/DropZone.css +2 -2
  66. package/dist/DropZone.mjs +4 -4
  67. package/dist/Field.cjs +23 -18
  68. package/dist/Field.cjs.map +1 -1
  69. package/dist/Field.css +7 -15
  70. package/dist/Field.css.map +1 -1
  71. package/dist/Field.mjs +23 -18
  72. package/dist/Field.mjs.map +1 -1
  73. package/dist/InlineAlert.cjs +24 -29
  74. package/dist/InlineAlert.cjs.map +1 -1
  75. package/dist/InlineAlert.css +15 -19
  76. package/dist/InlineAlert.css.map +1 -1
  77. package/dist/InlineAlert.mjs +24 -29
  78. package/dist/InlineAlert.mjs.map +1 -1
  79. package/dist/Link.cjs +7 -6
  80. package/dist/Link.cjs.map +1 -1
  81. package/dist/Link.css +14 -14
  82. package/dist/Link.css.map +1 -1
  83. package/dist/Link.mjs +7 -6
  84. package/dist/Link.mjs.map +1 -1
  85. package/dist/Menu.cjs +28 -8
  86. package/dist/Menu.cjs.map +1 -1
  87. package/dist/Menu.css +3 -3
  88. package/dist/Menu.css.map +1 -1
  89. package/dist/Menu.mjs +29 -9
  90. package/dist/Menu.mjs.map +1 -1
  91. package/dist/Meter.cjs +13 -13
  92. package/dist/Meter.cjs.map +1 -1
  93. package/dist/Meter.css +18 -22
  94. package/dist/Meter.css.map +1 -1
  95. package/dist/Meter.mjs +13 -13
  96. package/dist/Meter.mjs.map +1 -1
  97. package/dist/Modal.cjs +1 -1
  98. package/dist/Modal.css +1 -1
  99. package/dist/Modal.mjs +1 -1
  100. package/dist/NumberField.cjs +4 -4
  101. package/dist/NumberField.css +4 -4
  102. package/dist/NumberField.mjs +4 -4
  103. package/dist/Picker.cjs +4 -4
  104. package/dist/Picker.css +4 -4
  105. package/dist/Picker.mjs +4 -4
  106. package/dist/Popover.cjs +3 -3
  107. package/dist/Popover.css +3 -3
  108. package/dist/Popover.mjs +3 -3
  109. package/dist/ProgressBar.cjs +20 -18
  110. package/dist/ProgressBar.cjs.map +1 -1
  111. package/dist/ProgressBar.css +20 -24
  112. package/dist/ProgressBar.css.map +1 -1
  113. package/dist/ProgressBar.mjs +20 -18
  114. package/dist/ProgressBar.mjs.map +1 -1
  115. package/dist/ProgressCircle.cjs +11 -9
  116. package/dist/ProgressCircle.cjs.map +1 -1
  117. package/dist/ProgressCircle.css +14 -14
  118. package/dist/ProgressCircle.css.map +1 -1
  119. package/dist/ProgressCircle.mjs +11 -9
  120. package/dist/ProgressCircle.mjs.map +1 -1
  121. package/dist/Provider.cjs +1 -1
  122. package/dist/Provider.css +1 -1
  123. package/dist/Provider.mjs +1 -1
  124. package/dist/Radio.cjs +6 -6
  125. package/dist/Radio.css +6 -6
  126. package/dist/Radio.mjs +6 -6
  127. package/dist/SearchField.cjs +1 -1
  128. package/dist/SearchField.css +1 -1
  129. package/dist/SearchField.mjs +1 -1
  130. package/dist/SegmentedControl.cjs +8 -8
  131. package/dist/SegmentedControl.css +8 -8
  132. package/dist/SegmentedControl.mjs +8 -8
  133. package/dist/Slider.cjs +8 -8
  134. package/dist/Slider.css +5 -5
  135. package/dist/Slider.mjs +8 -8
  136. package/dist/Switch.cjs +7 -7
  137. package/dist/Switch.css +6 -6
  138. package/dist/Switch.mjs +7 -7
  139. package/dist/TableView.cjs +17 -17
  140. package/dist/TableView.css +11 -11
  141. package/dist/TableView.mjs +17 -17
  142. package/dist/Tabs.cjs +5 -5
  143. package/dist/Tabs.css +5 -5
  144. package/dist/Tabs.mjs +5 -5
  145. package/dist/TabsPicker.cjs +1 -1
  146. package/dist/TabsPicker.css +1 -1
  147. package/dist/TabsPicker.mjs +1 -1
  148. package/dist/TagGroup.cjs +10 -10
  149. package/dist/TagGroup.css +8 -8
  150. package/dist/TagGroup.mjs +10 -10
  151. package/dist/ToggleButton.cjs +1 -0
  152. package/dist/ToggleButton.cjs.map +1 -1
  153. package/dist/ToggleButton.css.map +1 -1
  154. package/dist/ToggleButton.mjs +1 -0
  155. package/dist/ToggleButton.mjs.map +1 -1
  156. package/dist/Tooltip.cjs +1 -1
  157. package/dist/Tooltip.css +1 -1
  158. package/dist/Tooltip.mjs +1 -1
  159. package/dist/types.d.ts +9 -9
  160. package/dist/types.d.ts.map +1 -1
  161. package/package.json +18 -18
  162. package/src/ActionButton.tsx +19 -43
  163. package/src/ActionButtonGroup.tsx +1 -1
  164. package/src/Button.tsx +36 -79
  165. package/src/CloseButton.tsx +10 -20
  166. package/src/Divider.tsx +10 -16
  167. package/src/Field.tsx +19 -17
  168. package/src/InlineAlert.tsx +0 -1
  169. package/src/Link.tsx +7 -12
  170. package/src/Menu.tsx +24 -8
  171. package/src/Meter.tsx +7 -14
  172. package/src/ProgressBar.tsx +8 -15
  173. package/src/ProgressCircle.tsx +12 -15
  174. package/src/ToggleButton.tsx +1 -0
  175. package/src/bar-utils.ts +3 -10
  176. package/src/style-utils.ts +15 -8
  177. package/style/dist/spectrum-theme.cjs +15 -1
  178. package/style/dist/spectrum-theme.cjs.map +1 -1
  179. package/style/dist/spectrum-theme.mjs +15 -1
  180. package/style/dist/spectrum-theme.mjs.map +1 -1
  181. package/style/dist/types.d.ts +40 -27
  182. package/style/dist/types.d.ts.map +1 -1
  183. package/style/spectrum-theme.ts +4 -2
  184. package/style/tokens.ts +30 -0
package/dist/Button.css CHANGED
@@ -11,12 +11,8 @@
11
11
  outline-color: var(--lightningcss-light, #4b75ff) var(--lightningcss-dark, #4069fd);
12
12
  }
13
13
 
14
- .dc {
15
- outline-color: #fff;
16
- }
17
-
18
- .db {
19
- outline-color: #000;
14
+ .d_____G {
15
+ outline-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / 1);
20
16
  }
21
17
 
22
18
  ._Nc {
@@ -27,6 +23,14 @@
27
23
  outline-offset: 2px;
28
24
  }
29
25
 
26
+ .-_1de2x0q_b-c {
27
+ --s2-container-bg: white;
28
+ }
29
+
30
+ .-_1de2x0q_b-b {
31
+ --s2-container-bg: black;
32
+ }
33
+
30
34
  .Uc {
31
35
  position: relative;
32
36
  }
@@ -89,6 +93,10 @@
89
93
  color: var(--lightningcss-light, #fff) var(--lightningcss-dark, #111);
90
94
  }
91
95
 
96
+ .ac {
97
+ color: #fff;
98
+ }
99
+
92
100
  .an {
93
101
  color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
94
102
  }
@@ -101,36 +109,20 @@
101
109
  color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
102
110
  }
103
111
 
104
- .ab {
105
- color: #000;
112
+ .a_____R {
113
+ color: lch(from var(--b, var(--s2-container-bg)) calc((49.44 - l) * infinity) 0 0 / 1);
106
114
  }
107
115
 
108
- .a_____e {
109
- color: #ffffffd9;
116
+ .a_____E {
117
+ color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .85);
110
118
  }
111
119
 
112
- .a_____f {
113
- color: #fffffff0;
120
+ .a_____F {
121
+ color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .94);
114
122
  }
115
123
 
116
- .a_____a {
117
- color: #ffffff36;
118
- }
119
-
120
- .ac {
121
- color: #fff;
122
- }
123
-
124
- .a_____r {
125
- color: #000000d6;
126
- }
127
-
128
- .a_____s {
129
- color: #000000ed;
130
- }
131
-
132
- .a_____n {
133
- color: #00000038;
124
+ .a_____A {
125
+ color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .21);
134
126
  }
135
127
 
136
128
  .__Da {
@@ -250,152 +242,128 @@
250
242
  border-color: var(--lightningcss-light, #dadada) var(--lightningcss-dark, #393939);
251
243
  }
252
244
 
253
- .c_____e {
254
- border-color: #ffffffd9;
245
+ .c_____E {
246
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .85);
255
247
  }
256
248
 
257
- .c_____f {
258
- border-color: #fffffff0;
249
+ .c_____F {
250
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .94);
251
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .94);
252
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .94);
259
253
  }
260
254
 
261
- .c_____a {
262
- border-color: #ffffff36;
255
+ .c_____A {
256
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .21);
257
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .21);
258
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .21);
263
259
  }
264
260
 
265
- .c____9 {
266
- border-color: #ffffff2b;
261
+ .c_____z {
262
+ border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .17);
267
263
  }
268
264
 
269
- .c_____r {
270
- border-color: #000000d6;
265
+ .b-375toh {
266
+ background-color: var(--b);
271
267
  }
272
268
 
273
- .c_____s {
274
- border-color: #000000ed;
275
- }
276
-
277
- .c_____n {
278
- border-color: #00000038;
279
- }
280
-
281
- .c_____m {
282
- border-color: #00000026;
283
- }
284
-
285
- .bn {
286
- background-color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
287
- }
288
-
289
- .bo {
290
- background-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
291
- }
292
-
293
- .bh {
294
- background-color: var(--lightningcss-light, #e1e1e1) var(--lightningcss-dark, #323232);
295
- }
296
-
297
- .b_____E {
298
- background-color: var(--lightningcss-light, #3b63fb) var(--lightningcss-dark, #4069fd);
299
- }
300
-
301
- .b_____F {
302
- background-color: var(--lightningcss-light, #274dea) var(--lightningcss-dark, #345bf8);
269
+ .-rwx0fg_e-b {
270
+ --iconPrimary: currentColor;
303
271
  }
304
272
 
305
- .b_____K {
306
- background-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #df3422);
273
+ ._zb {
274
+ forced-color-adjust: none;
307
275
  }
308
276
 
309
- .b_____L {
310
- background-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #cd2e1d);
277
+ .__R-yksgrp {
278
+ -webkit-tap-highlight-color: #0000;
311
279
  }
312
280
 
313
- .bg {
314
- background-color: var(--lightningcss-light, #e9e9e9) var(--lightningcss-dark, #2c2c2c);
281
+ .-_375tou_o-f {
282
+ --o: calc(2rem * var(--s2-scale));
315
283
  }
316
284
 
317
- .b_____e {
318
- background-color: #ffffffd9;
285
+ .-_375tou_o-g {
286
+ --o: calc(1.25rem * var(--s2-scale));
319
287
  }
320
288
 
321
- .b_____f {
322
- background-color: #fffffff0;
289
+ .-_375tou_o-h {
290
+ --o: calc(1.5rem * var(--s2-scale));
323
291
  }
324
292
 
325
- .b____8 {
326
- background-color: #ffffff24;
293
+ .-_375tou_o-i {
294
+ --o: calc(2.5rem * var(--s2-scale));
327
295
  }
328
296
 
329
- .b____7 {
330
- background-color: #ffffff1c;
297
+ .-_375tou_o-j {
298
+ --o: calc(3rem * var(--s2-scale));
331
299
  }
332
300
 
333
- .b_____r {
334
- background-color: #000000d6;
301
+ .-_375tp0_u-a {
302
+ --u: 0px;
335
303
  }
336
304
 
337
- .b_____s {
338
- background-color: #000000ed;
305
+ .-_375tp0_u-c {
306
+ --u: 2px;
339
307
  }
340
308
 
341
- .b_____l {
342
- background-color: #0000001f;
309
+ .-_375tp1_v-a {
310
+ --v: 0px;
343
311
  }
344
312
 
345
- .b_____k {
346
- background-color: #00000017;
313
+ .-_375tp1_v-c {
314
+ --v: 2px;
347
315
  }
348
316
 
349
- .ba {
350
- background-color: #0000;
317
+ .-_375toh_b-n {
318
+ --b: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
351
319
  }
352
320
 
353
- .-rwx0fg_e-b {
354
- --iconPrimary: currentColor;
321
+ .-_375toh_b-o {
322
+ --b: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
355
323
  }
356
324
 
357
- ._zb {
358
- forced-color-adjust: none;
325
+ .-_375toh_b-h {
326
+ --b: var(--lightningcss-light, #e1e1e1) var(--lightningcss-dark, #323232);
359
327
  }
360
328
 
361
- .__R-yksgrp {
362
- -webkit-tap-highlight-color: #0000;
329
+ .-_375toh_b-_____R {
330
+ --b: var(--lightningcss-light, #3b63fb) var(--lightningcss-dark, #4069fd);
363
331
  }
364
332
 
365
- .-_375tou_o-f {
366
- --o: calc(2rem * var(--s2-scale));
333
+ .-_375toh_b-_____S {
334
+ --b: var(--lightningcss-light, #274dea) var(--lightningcss-dark, #345bf8);
367
335
  }
368
336
 
369
- .-_375tou_o-g {
370
- --o: calc(1.25rem * var(--s2-scale));
337
+ .-_375toh_b-_____X {
338
+ --b: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #df3422);
371
339
  }
372
340
 
373
- .-_375tou_o-h {
374
- --o: calc(1.5rem * var(--s2-scale));
341
+ .-_375toh_b-_____Y {
342
+ --b: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #cd2e1d);
375
343
  }
376
344
 
377
- .-_375tou_o-i {
378
- --o: calc(2.5rem * var(--s2-scale));
345
+ .-_375toh_b-g {
346
+ --b: var(--lightningcss-light, #e9e9e9) var(--lightningcss-dark, #2c2c2c);
379
347
  }
380
348
 
381
- .-_375tou_o-j {
382
- --o: calc(3rem * var(--s2-scale));
349
+ .-_375toh_b-_____E {
350
+ --b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .85);
383
351
  }
384
352
 
385
- .-_375tp0_u-a {
386
- --u: 0px;
353
+ .-_375toh_b-_____F {
354
+ --b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .94);
387
355
  }
388
356
 
389
- .-_375tp0_u-c {
390
- --u: 2px;
357
+ .-_375toh_b-_____y {
358
+ --b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .14);
391
359
  }
392
360
 
393
- .-_375tp1_v-a {
394
- --v: 0px;
361
+ .-_375toh_b-_____x {
362
+ --b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .11);
395
363
  }
396
364
 
397
- .-_375tp1_v-c {
398
- --v: 2px;
365
+ .-_375toh_b-a {
366
+ --b: transparent;
399
367
  }
400
368
 
401
369
  .Ua {
@@ -577,52 +545,52 @@
577
545
 
578
546
  @layer _.b.a {
579
547
  @media (forced-colors: active) {
580
- .da_____z {
548
+ .da_____M {
581
549
  outline-color: highlight;
582
550
  }
583
551
 
584
- .aa_____w {
552
+ .aa_____J {
585
553
  color: buttonface;
586
554
  }
587
555
 
588
- .aa_____A {
556
+ .aa_____N {
589
557
  color: highlighttext;
590
558
  }
591
559
 
592
- .aa_____x {
560
+ .aa_____K {
593
561
  color: buttontext;
594
562
  }
595
563
 
596
- .aa_____B {
564
+ .aa_____O {
597
565
  color: graytext;
598
566
  }
599
567
 
600
- .ca_____v {
568
+ .ca_____I {
601
569
  border-color: buttonborder;
602
570
  }
603
571
 
604
- .ca_____z {
572
+ .ca_____M {
605
573
  border-color: highlight;
606
574
  }
607
575
 
608
- .ca_____B {
576
+ .ca_____O {
609
577
  border-color: graytext;
610
578
  }
611
579
 
612
- .ba_____x {
613
- background-color: buttontext;
580
+ .-_375toh_b-a_____K {
581
+ --b: ButtonText;
614
582
  }
615
583
 
616
- .ba_____z {
617
- background-color: highlight;
584
+ .-_375toh_b-a_____M {
585
+ --b: Highlight;
618
586
  }
619
587
 
620
- .ba_____B {
621
- background-color: graytext;
588
+ .-_375toh_b-a_____O {
589
+ --b: GrayText;
622
590
  }
623
591
 
624
- .ba_____w {
625
- background-color: buttonface;
592
+ .-_375toh_b-a_____J {
593
+ --b: ButtonFace;
626
594
  }
627
595
  }
628
596
  }
@@ -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;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA4SQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6CF;;;;EAAA;;;;EAAA;;;;EAKsC;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA9WL;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;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAiRK","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, 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, 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',\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'\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>({\n ...focusRing(),\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 },\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 staticColor: {\n white: {\n variant: {\n primary: baseColor('transparent-white-800'),\n secondary: baseColor('transparent-white-300')\n },\n isDisabled: 'transparent-white-300'\n },\n black: {\n variant: {\n primary: baseColor('transparent-black-800'),\n secondary: baseColor('transparent-black-300')\n },\n isDisabled: 'transparent-black-300'\n }\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 },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'transparent',\n isHovered: 'gray-100',\n isPressed: 'gray-100',\n isFocusVisible: 'gray-100',\n isDisabled: 'transparent'\n }\n },\n staticColor: {\n white: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-white-800'),\n secondary: baseColor('transparent-white-100')\n },\n isDisabled: 'transparent-white-100'\n },\n outline: {\n default: 'transparent',\n isHovered: 'transparent-white-100',\n isPressed: 'transparent-white-100',\n isFocusVisible: 'transparent-white-100',\n isDisabled: 'transparent'\n }\n }\n },\n black: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-black-800'),\n secondary: baseColor('transparent-black-100')\n },\n isDisabled: 'transparent-black-100'\n },\n outline: {\n default: 'transparent',\n isHovered: 'transparent-black-100',\n isPressed: 'transparent-black-100',\n isFocusVisible: 'transparent-black-100',\n isDisabled: 'transparent'\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 },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n isDisabled: 'disabled'\n }\n },\n staticColor: {\n white: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'black',\n secondary: baseColor('transparent-white-800')\n }\n },\n outline: baseColor('transparent-white-800')\n },\n isDisabled: 'transparent-white-400'\n },\n black: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'white',\n secondary: baseColor('transparent-black-800')\n }\n },\n outline: baseColor('transparent-black-800')\n },\n isDisabled: 'transparent-black-400'\n }\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 staticColor: {\n white: 'white',\n black: 'black'\n },\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 }, 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 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;;;;EAgQQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8CF;;;;EAAA;;;;EAAA;;;;EAKsC;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnUL;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;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAqOK","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, 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',\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 },\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 },\n isDisabled: 'disabled'\n },\n outline: {\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 },\n isDisabled: 'transparent-overlay-100'\n },\n outline: {\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 },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n isDisabled: 'disabled'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'auto',\n secondary: baseColor('transparent-overlay-800')\n }\n },\n outline: baseColor('transparent-overlay-800')\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"}