@react-spectrum/s2 3.0.0-nightly-835f0aa1b-250107 → 3.0.0-nightly-d87cc4422-250109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.cjs +3 -3
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.mjs +3 -3
- package/dist/ActionBar.cjs +32 -32
- package/dist/ActionBar.css +34 -34
- package/dist/ActionBar.mjs +32 -32
- package/dist/ActionButton.cjs +61 -61
- package/dist/ActionButton.css +56 -56
- package/dist/ActionButton.mjs +61 -61
- package/dist/ActionButtonGroup.cjs +4 -4
- package/dist/ActionButtonGroup.css +3 -3
- package/dist/ActionButtonGroup.mjs +4 -4
- package/dist/Avatar.cjs +10 -10
- package/dist/Avatar.css +11 -11
- package/dist/Avatar.mjs +10 -10
- package/dist/AvatarGroup.cjs +97 -97
- package/dist/AvatarGroup.css +31 -31
- package/dist/AvatarGroup.mjs +97 -97
- package/dist/Badge.cjs +31 -31
- package/dist/Badge.css +33 -33
- package/dist/Badge.mjs +31 -31
- package/dist/Breadcrumbs.cjs +83 -82
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css +65 -59
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +83 -82
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +82 -77
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +65 -65
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +82 -77
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +15 -15
- package/dist/ButtonGroup.css +11 -11
- package/dist/ButtonGroup.mjs +15 -15
- package/dist/Card.cjs +157 -157
- package/dist/Card.css +117 -117
- package/dist/Card.mjs +157 -157
- package/dist/CardView.cjs +13 -13
- package/dist/CardView.css +14 -14
- package/dist/CardView.mjs +13 -13
- package/dist/CenterBaseline.cjs +1 -1
- package/dist/CenterBaseline.css +2 -2
- package/dist/CenterBaseline.mjs +1 -1
- package/dist/Checkbox.cjs +46 -46
- package/dist/Checkbox.css +42 -42
- package/dist/Checkbox.mjs +46 -46
- package/dist/CheckboxGroup.cjs +36 -36
- package/dist/CheckboxGroup.css +32 -32
- package/dist/CheckboxGroup.mjs +36 -36
- package/dist/ClearButton.cjs +5 -5
- package/dist/ClearButton.css +5 -5
- package/dist/ClearButton.mjs +5 -5
- package/dist/CloseButton.cjs +15 -15
- package/dist/CloseButton.css +15 -15
- package/dist/CloseButton.mjs +15 -15
- package/dist/ColorArea.cjs +9 -9
- package/dist/ColorArea.css +9 -9
- package/dist/ColorArea.mjs +9 -9
- package/dist/ColorField.cjs +29 -29
- package/dist/ColorField.css +24 -24
- package/dist/ColorField.mjs +29 -29
- package/dist/ColorHandle.cjs +9 -9
- package/dist/ColorHandle.css +16 -16
- package/dist/ColorHandle.mjs +9 -9
- package/dist/ColorSlider.cjs +34 -34
- package/dist/ColorSlider.css +42 -42
- package/dist/ColorSlider.mjs +34 -34
- package/dist/ColorSwatch.cjs +6 -6
- package/dist/ColorSwatch.css +14 -14
- package/dist/ColorSwatch.mjs +6 -6
- package/dist/ColorSwatchPicker.cjs +12 -12
- package/dist/ColorSwatchPicker.css +32 -32
- package/dist/ColorSwatchPicker.mjs +12 -12
- package/dist/ColorWheel.cjs +14 -14
- package/dist/ColorWheel.css +14 -14
- package/dist/ColorWheel.mjs +14 -14
- package/dist/ComboBox.cjs +51 -48
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +47 -47
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +51 -48
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +5 -5
- package/dist/ContextualHelp.css +23 -23
- package/dist/ContextualHelp.mjs +5 -5
- package/dist/CustomDialog.cjs +8 -8
- package/dist/CustomDialog.css +9 -9
- package/dist/CustomDialog.mjs +8 -8
- package/dist/Dialog.cjs +10 -10
- package/dist/Dialog.css +39 -39
- package/dist/Dialog.mjs +10 -10
- package/dist/Disclosure.cjs +53 -53
- package/dist/Disclosure.css +47 -47
- package/dist/Disclosure.mjs +53 -53
- package/dist/Divider.cjs +5 -5
- package/dist/Divider.css +5 -5
- package/dist/Divider.mjs +5 -5
- package/dist/DropZone.cjs +24 -24
- package/dist/DropZone.css +24 -24
- package/dist/DropZone.mjs +24 -24
- package/dist/Field.cjs +98 -98
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +68 -68
- package/dist/Field.mjs +98 -98
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +4 -4
- package/dist/Form.css +3 -3
- package/dist/Form.mjs +4 -4
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.css +54 -54
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/IllustratedMessage.cjs +117 -117
- package/dist/IllustratedMessage.css +58 -58
- package/dist/IllustratedMessage.mjs +117 -117
- package/dist/Image.cjs +10 -10
- package/dist/Image.css +11 -11
- package/dist/Image.mjs +10 -10
- package/dist/InlineAlert.cjs +41 -41
- package/dist/InlineAlert.css +44 -44
- package/dist/InlineAlert.mjs +41 -41
- package/dist/Link.cjs +27 -27
- package/dist/Link.css +27 -27
- package/dist/Link.mjs +27 -27
- package/dist/Menu.cjs +278 -207
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +114 -112
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +278 -207
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +45 -45
- package/dist/Meter.css +51 -51
- package/dist/Meter.mjs +45 -45
- package/dist/Modal.cjs +37 -37
- package/dist/Modal.css +35 -35
- package/dist/Modal.mjs +37 -37
- package/dist/NumberField.cjs +57 -57
- package/dist/NumberField.css +65 -65
- package/dist/NumberField.mjs +57 -57
- package/dist/Picker.cjs +114 -111
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +79 -79
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +114 -111
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +40 -40
- package/dist/Popover.css +37 -37
- package/dist/Popover.mjs +40 -40
- package/dist/ProgressBar.cjs +57 -57
- package/dist/ProgressBar.css +61 -61
- package/dist/ProgressBar.mjs +57 -57
- package/dist/ProgressCircle.cjs +3 -3
- package/dist/ProgressCircle.css +2 -2
- package/dist/ProgressCircle.mjs +3 -3
- package/dist/Provider.cjs +4 -4
- package/dist/Provider.css +5 -5
- package/dist/Provider.mjs +4 -4
- package/dist/Radio.cjs +46 -46
- package/dist/Radio.css +42 -42
- package/dist/Radio.mjs +46 -46
- package/dist/RadioGroup.cjs +34 -34
- package/dist/RadioGroup.css +32 -32
- package/dist/RadioGroup.mjs +34 -34
- package/dist/SearchField.cjs +31 -31
- package/dist/SearchField.css +29 -29
- package/dist/SearchField.mjs +31 -31
- package/dist/SegmentedControl.cjs +54 -54
- package/dist/SegmentedControl.css +54 -54
- package/dist/SegmentedControl.mjs +54 -54
- package/dist/Slider.cjs +89 -89
- package/dist/Slider.css +82 -82
- package/dist/Slider.mjs +89 -89
- package/dist/StatusLight.cjs +26 -26
- package/dist/StatusLight.css +26 -26
- package/dist/StatusLight.mjs +26 -26
- package/dist/Switch.cjs +47 -47
- package/dist/Switch.css +40 -40
- package/dist/Switch.mjs +47 -47
- package/dist/TableView.cjs +137 -137
- package/dist/TableView.css +76 -76
- package/dist/TableView.mjs +137 -137
- package/dist/Tabs.cjs +60 -60
- package/dist/Tabs.css +52 -52
- package/dist/Tabs.mjs +60 -60
- package/dist/TabsPicker.cjs +63 -63
- package/dist/TabsPicker.css +61 -61
- package/dist/TabsPicker.mjs +63 -63
- package/dist/TagGroup.cjs +102 -102
- package/dist/TagGroup.css +84 -84
- package/dist/TagGroup.mjs +102 -102
- package/dist/TextField.cjs +36 -36
- package/dist/TextField.css +33 -33
- package/dist/TextField.mjs +36 -36
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.css +7 -7
- package/dist/ToggleButton.mjs +3 -3
- package/dist/Tooltip.cjs +29 -29
- package/dist/Tooltip.css +31 -31
- package/dist/Tooltip.mjs +29 -29
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/icons/Skeleton.cjs +2 -2
- package/icons/Skeleton.css +5 -5
- package/icons/Skeleton.mjs +2 -2
- package/package.json +19 -19
- package/src/Button.tsx +18 -7
- package/src/ComboBox.tsx +2 -1
- package/src/Menu.tsx +40 -17
- package/src/Picker.tsx +2 -1
- package/style/dist/spectrum-theme.cjs +12 -1
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +12 -1
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/types.d.ts +2 -0
- package/style/dist/types.d.ts.map +1 -1
- package/style/spectrum-theme.ts +9 -1
package/dist/Button.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
@layer _.a {
|
|
2
|
-
.
|
|
2
|
+
._Ma {
|
|
3
3
|
outline-style: none;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
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
|
-
.
|
|
18
|
+
._Oc {
|
|
19
19
|
outline-width: 2px;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.
|
|
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
|
-
.
|
|
34
|
+
.Vc {
|
|
35
35
|
position: relative;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.
|
|
38
|
+
._0d {
|
|
39
39
|
display: flex;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.
|
|
42
|
+
._2d {
|
|
43
43
|
align-items: baseline;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
._3d {
|
|
47
47
|
justify-content: center;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.
|
|
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
|
-
.
|
|
58
|
+
._da {
|
|
59
59
|
font-family: adobe-clean-variable, adobe-clean, ui-sans-serif, system-ui, sans-serif;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.
|
|
62
|
+
._ee {
|
|
63
63
|
font-size: .875rem;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
.
|
|
66
|
+
._ea {
|
|
67
67
|
font-size: .6875rem;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
.
|
|
70
|
+
._ec {
|
|
71
71
|
font-size: .75rem;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
.
|
|
74
|
+
._eg {
|
|
75
75
|
font-size: 1rem;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
.
|
|
78
|
+
._ei {
|
|
79
79
|
font-size: 1.125rem;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
137
|
+
._wg {
|
|
138
138
|
border-start-start-radius: calc(var(--k, var(--o, 9999px)) / 2);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
.
|
|
141
|
+
._xg {
|
|
142
142
|
border-start-end-radius: calc(var(--k, var(--o, 9999px)) / 2);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
.
|
|
145
|
+
._yg {
|
|
146
146
|
border-end-start-radius: calc(var(--k, var(--o, 9999px)) / 2);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.
|
|
149
|
+
._zg {
|
|
150
150
|
border-end-end-radius: calc(var(--k, var(--o, 9999px)) / 2);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
.
|
|
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
|
-
.
|
|
161
|
+
._md {
|
|
162
162
|
text-decoration: none;
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -178,15 +178,15 @@
|
|
|
178
178
|
padding-bottom: 0;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.
|
|
181
|
+
._Pa {
|
|
182
182
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
.
|
|
185
|
+
._R-375x7f {
|
|
186
186
|
transition-duration: .15s;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
.
|
|
189
|
+
._Sa {
|
|
190
190
|
transition-timing-function: cubic-bezier(.45, 0, .4, 1);
|
|
191
191
|
}
|
|
192
192
|
|
|
@@ -262,23 +262,23 @@
|
|
|
262
262
|
border-color: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .17);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
.
|
|
265
|
+
._C-riuwfd {
|
|
266
266
|
background-image: linear-gradient(96deg, var(--lightningcss-light, #b539c8) var(--lightningcss-dark, #d549eb) 0%, var(--lightningcss-light, #7155fa) var(--lightningcss-dark, #8077fe) 66%, var(--lightningcss-light, #3b63fb) var(--lightningcss-dark, #5681ff) 100%);
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
.
|
|
269
|
+
._C-2xhv0x {
|
|
270
270
|
background-image: linear-gradient(96deg, var(--lightningcss-light, #9c28af) var(--lightningcss-dark, #e85bfd) 0%, var(--lightningcss-light, #6338ee) var(--lightningcss-dark, #8b8dfe) 66%, var(--lightningcss-light, #274dea) var(--lightningcss-dark, #6995fe) 100%);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
.
|
|
273
|
+
._C-u0nzys {
|
|
274
274
|
background-image: linear-gradient(96deg, var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e) 0%, var(--lightningcss-light, #d92361) var(--lightningcss-dark, #f37) 33%, var(--lightningcss-light, #7155fa) var(--lightningcss-dark, #8077fe) 100%);
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
.
|
|
277
|
+
._C-1gcd5pl {
|
|
278
278
|
background-image: linear-gradient(96deg, var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756) 0%, var(--lightningcss-light, #ba1650) var(--lightningcss-dark, #ff6095) 33%, var(--lightningcss-light, #6338ee) var(--lightningcss-dark, #8b8dfe) 100%);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
.
|
|
281
|
+
._C-yknrp1 {
|
|
282
282
|
background-image: none;
|
|
283
283
|
}
|
|
284
284
|
|
|
@@ -290,11 +290,11 @@
|
|
|
290
290
|
--iconPrimary: currentColor;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
.
|
|
293
|
+
._Ab {
|
|
294
294
|
forced-color-adjust: none;
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
.
|
|
297
|
+
.__S-yksgrp {
|
|
298
298
|
-webkit-tap-highlight-color: #0000;
|
|
299
299
|
}
|
|
300
300
|
|
|
@@ -334,6 +334,10 @@
|
|
|
334
334
|
--v: 0px;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
+
.-_375toh_b-n {
|
|
338
|
+
--b: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
|
|
339
|
+
}
|
|
340
|
+
|
|
337
341
|
.-_375toh_b-o {
|
|
338
342
|
--b: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
|
|
339
343
|
}
|
|
@@ -374,39 +378,35 @@
|
|
|
374
378
|
--b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .14);
|
|
375
379
|
}
|
|
376
380
|
|
|
377
|
-
.-_375toh_b-
|
|
378
|
-
--b:
|
|
381
|
+
.-_375toh_b-a {
|
|
382
|
+
--b: transparent;
|
|
379
383
|
}
|
|
380
384
|
|
|
381
385
|
.-_375toh_b-_____x {
|
|
382
386
|
--b: lch(from var(--s2-container-bg) calc((49.44 - l) * infinity) 0 0 / .11);
|
|
383
387
|
}
|
|
384
388
|
|
|
385
|
-
|
|
386
|
-
--b: transparent;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
.Ua {
|
|
389
|
+
.Va {
|
|
390
390
|
position: absolute;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
.
|
|
393
|
+
.Y-3760fj {
|
|
394
394
|
top: 50%;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
.
|
|
397
|
+
.Z-3760fj {
|
|
398
398
|
left: 50%;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
-
.
|
|
401
|
+
.U-1tktoou {
|
|
402
402
|
transform: translate(-50%, -50%);
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
.
|
|
405
|
+
._L-3t1x {
|
|
406
406
|
opacity: 0;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
.
|
|
409
|
+
._L-3t1y {
|
|
410
410
|
opacity: 1;
|
|
411
411
|
}
|
|
412
412
|
|
|
@@ -450,11 +450,11 @@
|
|
|
450
450
|
padding-bottom: var(--labelPadding);
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
.
|
|
453
|
+
.__B-3t1y {
|
|
454
454
|
order: 1;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
.
|
|
457
|
+
.__B-3t1x {
|
|
458
458
|
order: 0;
|
|
459
459
|
}
|
|
460
460
|
|
|
@@ -470,21 +470,21 @@
|
|
|
470
470
|
margin-inline-start: var(--iconMargin);
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
-
.
|
|
473
|
+
._9-3t1x {
|
|
474
474
|
flex-shrink: 0;
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
@layer _.b {
|
|
479
|
-
.
|
|
479
|
+
._2-soocicc:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
|
|
480
480
|
align-items: center;
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
.
|
|
483
|
+
._d-enzrfpb:lang(ar) {
|
|
484
484
|
font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
.
|
|
487
|
+
._g-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
|
|
488
488
|
line-height: 1.5;
|
|
489
489
|
}
|
|
490
490
|
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
padding-inline-end: 0;
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
.
|
|
519
|
+
._c-soocicb:has([slot="icon"]):not(:has([data-rsp-slot="text"])) {
|
|
520
520
|
aspect-ratio: 1;
|
|
521
521
|
}
|
|
522
522
|
|
|
@@ -526,37 +526,37 @@
|
|
|
526
526
|
}
|
|
527
527
|
|
|
528
528
|
@layer _.c {
|
|
529
|
-
.
|
|
529
|
+
._d-enzwzjc:lang(he) {
|
|
530
530
|
font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
|
|
534
534
|
@layer _.d {
|
|
535
|
-
.
|
|
535
|
+
._d-enzykdd:lang(ja) {
|
|
536
536
|
font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
|
|
540
540
|
@layer _.e {
|
|
541
|
-
.
|
|
541
|
+
._d-enzzrge:lang(ko) {
|
|
542
542
|
font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
@layer _.f {
|
|
547
|
-
.
|
|
547
|
+
._d-eo0c6sf:lang(zh) {
|
|
548
548
|
font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
@layer _.g {
|
|
553
|
-
.
|
|
553
|
+
._d-1uotwbwg:lang(zh-hant) {
|
|
554
554
|
font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
@layer _.h {
|
|
559
|
-
.
|
|
559
|
+
._d-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
|
|
560
560
|
font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
|
|
561
561
|
}
|
|
562
562
|
}
|
|
@@ -597,7 +597,7 @@
|
|
|
597
597
|
border-color: graytext;
|
|
598
598
|
}
|
|
599
599
|
|
|
600
|
-
.
|
|
600
|
+
._Ca-yknrp1 {
|
|
601
601
|
background-image: none;
|
|
602
602
|
}
|
|
603
603
|
|
|
@@ -625,23 +625,23 @@
|
|
|
625
625
|
column-gap: .470588em;
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
-
.
|
|
628
|
+
._ebf {
|
|
629
629
|
font-size: 1.0625rem;
|
|
630
630
|
}
|
|
631
631
|
|
|
632
|
-
.
|
|
632
|
+
._ebb {
|
|
633
633
|
font-size: .8125rem;
|
|
634
634
|
}
|
|
635
635
|
|
|
636
|
-
.
|
|
636
|
+
._ebd {
|
|
637
637
|
font-size: .9375rem;
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
-
.
|
|
640
|
+
._ebh {
|
|
641
641
|
font-size: 1.1875rem;
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
-
.
|
|
644
|
+
._ebj {
|
|
645
645
|
font-size: 1.375rem;
|
|
646
646
|
}
|
|
647
647
|
}
|
package/dist/Button.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACmEe;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiTQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8CF;;;;EAAA;;;;EAAA;;;;EAKsC;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AApXL;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAsRK","sources":["47c518d02ef77298","packages/@react-spectrum/s2/src/Button.tsx"],"sourcesContent":["@import \"84fda4530d887d61\";\n@import \"58029840d81c849c\";\n@import \"741c49b4968f5e00\";\n@import \"d2d5d6a0faea83be\";\n@import \"7420f4e12e7ef59c\";\n@import \"b849e4ca63c3cc49\";\n@import \"36ff0e1e9ec0e357\";\n@import \"5ed629d4d0b8048c\";\n@import \"341672feb3593eb4\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {baseColor, focusRing, fontRelative, linearGradient, style} from '../style' with {type: 'macro'};\nimport {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonStyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button.\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'accent' | 'negative' | 'premium' | 'genai',\n /**\n * The background style of the Button.\n *\n * @default 'fill'\n */\n fillStyle?: 'fill' | 'outline',\n /**\n * The size of the Button.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the Button appears over a color background. */\n staticColor?: 'white' | 'black' | 'auto'\n}\n\nexport interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);\nexport const LinkButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLAnchorElement>>>(null);\n\nconst iconOnly = ':has([slot=icon]):not(:has([data-rsp-slot=text]))';\nconst button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n position: 'relative',\n display: 'flex',\n alignItems: {\n default: 'baseline',\n [iconOnly]: 'center'\n },\n justifyContent: 'center',\n textAlign: 'start',\n columnGap: 'text-to-visual',\n font: 'control',\n fontWeight: 'bold',\n userSelect: 'none',\n minHeight: 'control',\n minWidth: {\n [iconOnly]: 'control'\n },\n borderRadius: 'pill',\n boxSizing: 'border-box',\n width: 'fit',\n textDecoration: 'none', // for link buttons\n paddingX: {\n default: 'pill',\n [iconOnly]: 0\n },\n paddingY: 0,\n aspectRatio: {\n [iconOnly]: 'square'\n },\n transition: 'default',\n borderStyle: 'solid',\n borderWidth: {\n fillStyle: {\n fill: 0,\n outline: 2\n },\n variant: {\n premium: 0,\n genai: 0\n }\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n borderColor: {\n variant: {\n primary: baseColor('gray-800'),\n secondary: baseColor('gray-300')\n },\n isDisabled: 'disabled',\n isStaticColor: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-300')\n },\n isDisabled: 'transparent-overlay-300'\n },\n forcedColors: {\n default: 'ButtonBorder',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n backgroundImage: {\n variant: {\n premium: {\n default: linearGradient('96deg', ['fuchsia-900', 0], ['indigo-900', 66], ['blue-900', 100]),\n isHovered: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isPressed: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100])\n },\n genai: {\n default: linearGradient('96deg', ['red-900', 0], ['magenta-900', 33], ['indigo-900', 100]),\n isHovered: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isPressed: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100])\n }\n },\n isDisabled: 'none',\n isPending: 'none',\n forcedColors: 'none'\n },\n backgroundColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'neutral',\n secondary: baseColor('gray-100'),\n accent: 'accent',\n negative: 'negative',\n premium: 'gray-100',\n genai: 'gray-100'\n },\n isDisabled: 'disabled'\n },\n outline: {\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n },\n default: 'transparent',\n isHovered: 'gray-100',\n isPressed: 'gray-100',\n isFocusVisible: 'gray-100',\n isDisabled: 'transparent'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-100'),\n premium: 'gray-800',\n genai: 'gray-800'\n },\n isDisabled: 'transparent-overlay-100'\n },\n outline: {\n variant: {\n premium: 'gray-800',\n genai: 'gray-800'\n },\n default: 'transparent',\n isHovered: 'transparent-overlay-100',\n isPressed: 'transparent-overlay-100',\n isFocusVisible: 'transparent-overlay-100',\n isDisabled: 'transparent'\n }\n }\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n },\n outline: 'ButtonFace'\n }\n }\n },\n color: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'gray-25',\n secondary: 'neutral',\n accent: 'white',\n negative: 'white',\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n variant: {\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'auto',\n secondary: baseColor('transparent-overlay-800'),\n premium: 'white',\n genai: 'white'\n }\n },\n outline: {\n variant: {\n premium: 'white',\n genai: 'white'\n },\n default: baseColor('transparent-overlay-800')\n }\n },\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonFace',\n isDisabled: 'HighlightText'\n },\n outline: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n forcedColorAdjust: 'none',\n disableTapHighlight: true\n}, getAllowedOverrides());\n\n/**\n * Buttons allow users to perform an action.\n * They have multiple styles for various needs, and are ideal for calling attention to\n * where a user needs to do something in order to move forward in a flow.\n */\nexport const Button = forwardRef(function Button(props: ButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonContext);\n props = useFormProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isPending,\n variant = 'primary',\n fillStyle = 'fill',\n size = 'M',\n staticColor\n } = props;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n let [isProgressVisible, setIsProgressVisible] = useState(false);\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n\n if (isPending) {\n // Start timer when isPending is set to true.\n timeout = setTimeout(() => {\n setIsProgressVisible(true);\n }, 1000);\n } else {\n // Exit loading state when isPending is set to false. */\n setIsProgressVisible(false);\n }\n return () => {\n // Clean up on unmount or when user removes isPending prop before entering loading state.\n clearTimeout(timeout);\n };\n }, [isPending]);\n\n return (\n <RACButton\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n variant,\n fillStyle,\n size,\n staticColor,\n isStaticColor: !!staticColor\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({\n paddingY: '--labelPadding',\n order: 1,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n flexShrink: 0,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n {isPending &&\n <div\n className={style({\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translate(-50%, -50%)',\n opacity: {\n default: 0,\n isProgressVisible: 1\n }\n })({isProgressVisible, isPending})}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('button.pending')}\n size=\"S\"\n staticColor={staticColor}\n styles={style({\n size: {\n size: {\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})} />\n </div>\n }\n </Provider>\n </RACButton>\n );\n});\n\n/**\n * A LinkButton combines the functionality of a link with the appearance of a button. Useful for allowing users to navigate to another page.\n */\nexport const LinkButton = forwardRef(function LinkButton(props: LinkButtonProps, ref: FocusableRef<HTMLAnchorElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, LinkButtonContext);\n props = useFormProps(props);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n return (\n <Link\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n variant: props.variant || 'primary',\n fillStyle: props.fillStyle || 'fill',\n size: props.size || 'M',\n staticColor: props.staticColor,\n isStaticColor: !!props.staticColor,\n isPending: false\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({paddingY: '--labelPadding', order: 1}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </Link>\n );\n});\n"],"names":[],"version":3,"file":"Button.css.map"}
|
|
1
|
+
{"mappings":"ACmEe;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA4TQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8CF;;;;EAAA;;;;EAAA;;;;EAKsC;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA/XL;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAiSK","sources":["47c518d02ef77298","packages/@react-spectrum/s2/src/Button.tsx"],"sourcesContent":["@import \"84fda4530d887d61\";\n@import \"58029840d81c849c\";\n@import \"741c49b4968f5e00\";\n@import \"d2d5d6a0faea83be\";\n@import \"7420f4e12e7ef59c\";\n@import \"b849e4ca63c3cc49\";\n@import \"36ff0e1e9ec0e357\";\n@import \"5ed629d4d0b8048c\";\n@import \"341672feb3593eb4\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {baseColor, focusRing, fontRelative, linearGradient, style} from '../style' with {type: 'macro'};\nimport {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateContext, Provider, Button as RACButton, ButtonProps as RACButtonProps} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {ProgressCircle} from './ProgressCircle';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface ButtonStyleProps {\n /**\n * The [visual style](https://spectrum.adobe.com/page/button/#Options) of the button.\n *\n * @default 'primary'\n */\n variant?: 'primary' | 'secondary' | 'accent' | 'negative' | 'premium' | 'genai',\n /**\n * The background style of the Button.\n *\n * @default 'fill'\n */\n fillStyle?: 'fill' | 'outline',\n /**\n * The size of the Button.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the Button appears over a color background. */\n staticColor?: 'white' | 'black' | 'auto'\n}\n\nexport interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children'>, StyleProps, ButtonStyleProps {\n /** The content to display in the Button. */\n children?: ReactNode\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLButtonElement>>>(null);\nexport const LinkButtonContext = createContext<ContextValue<ButtonProps, FocusableRefValue<HTMLAnchorElement>>>(null);\n\nconst iconOnly = ':has([slot=icon]):not(:has([data-rsp-slot=text]))';\nconst button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n position: 'relative',\n display: 'flex',\n alignItems: {\n default: 'baseline',\n [iconOnly]: 'center'\n },\n justifyContent: 'center',\n textAlign: 'start',\n columnGap: 'text-to-visual',\n font: 'control',\n fontWeight: 'bold',\n userSelect: 'none',\n minHeight: 'control',\n minWidth: {\n [iconOnly]: 'control'\n },\n borderRadius: 'pill',\n boxSizing: 'border-box',\n width: 'fit',\n textDecoration: 'none', // for link buttons\n paddingX: {\n default: 'pill',\n [iconOnly]: 0\n },\n paddingY: 0,\n aspectRatio: {\n [iconOnly]: 'square'\n },\n transition: 'default',\n borderStyle: 'solid',\n borderWidth: {\n fillStyle: {\n fill: 0,\n outline: 2\n },\n variant: {\n premium: 0,\n genai: 0\n }\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n borderColor: {\n variant: {\n primary: baseColor('gray-800'),\n secondary: baseColor('gray-300')\n },\n isDisabled: 'disabled',\n isStaticColor: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-300')\n },\n isDisabled: 'transparent-overlay-300'\n },\n forcedColors: {\n default: 'ButtonBorder',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n backgroundImage: {\n variant: {\n premium: {\n default: linearGradient('96deg', ['fuchsia-900', 0], ['indigo-900', 66], ['blue-900', 100]),\n isHovered: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isPressed: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['fuchsia-1000', 0], ['indigo-1000', 66], ['blue-1000', 100])\n },\n genai: {\n default: linearGradient('96deg', ['red-900', 0], ['magenta-900', 33], ['indigo-900', 100]),\n isHovered: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isPressed: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100]),\n isFocusVisible: linearGradient('96deg', ['red-1000', 0], ['magenta-1000', 33], ['indigo-1000', 100])\n }\n },\n isDisabled: 'none',\n forcedColors: 'none'\n },\n backgroundColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'neutral',\n secondary: baseColor('gray-100'),\n accent: 'accent',\n negative: 'negative',\n premium: 'gray-100',\n genai: 'gray-100'\n },\n isDisabled: 'disabled'\n },\n outline: {\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n },\n default: 'transparent',\n isHovered: 'gray-100',\n isPressed: 'gray-100',\n isFocusVisible: 'gray-100',\n isDisabled: {\n default: 'transparent',\n variant: {\n premium: 'gray-100',\n genai: 'gray-100'\n }\n }\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: baseColor('transparent-overlay-800'),\n secondary: baseColor('transparent-overlay-100'),\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n },\n isDisabled: 'transparent-overlay-100'\n },\n outline: {\n variant: {\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n },\n default: 'transparent',\n isHovered: 'transparent-overlay-100',\n isPressed: 'transparent-overlay-100',\n isFocusVisible: 'transparent-overlay-100',\n isDisabled: {\n default: 'transparent',\n variant: {\n premium: 'transparent-overlay-100',\n genai: 'transparent-overlay-100'\n }\n }\n }\n }\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonText',\n isHovered: 'Highlight',\n isDisabled: 'GrayText'\n },\n outline: 'ButtonFace'\n }\n }\n },\n color: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'gray-25',\n secondary: 'neutral',\n accent: 'white',\n negative: 'white',\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n },\n outline: {\n default: 'neutral',\n variant: {\n premium: 'white',\n genai: 'white'\n },\n isDisabled: 'disabled'\n }\n },\n isStaticColor: {\n fillStyle: {\n fill: {\n variant: {\n primary: 'auto',\n secondary: baseColor('transparent-overlay-800'),\n premium: 'white',\n genai: 'white'\n }\n },\n outline: {\n variant: {\n premium: 'white',\n genai: 'white'\n },\n default: baseColor('transparent-overlay-800')\n }\n },\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n fillStyle: {\n fill: {\n default: 'ButtonFace',\n isDisabled: 'HighlightText'\n },\n outline: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n forcedColorAdjust: 'none',\n disableTapHighlight: true\n}, getAllowedOverrides());\n\n/**\n * Buttons allow users to perform an action.\n * They have multiple styles for various needs, and are ideal for calling attention to\n * where a user needs to do something in order to move forward in a flow.\n */\nexport const Button = forwardRef(function Button(props: ButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ButtonContext);\n props = useFormProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isPending,\n variant = 'primary',\n fillStyle = 'fill',\n size = 'M',\n staticColor\n } = props;\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n let [isProgressVisible, setIsProgressVisible] = useState(false);\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n\n if (isPending) {\n // Start timer when isPending is set to true.\n timeout = setTimeout(() => {\n setIsProgressVisible(true);\n }, 1000);\n } else {\n // Exit loading state when isPending is set to false. */\n setIsProgressVisible(false);\n }\n return () => {\n // Clean up on unmount or when user removes isPending prop before entering loading state.\n clearTimeout(timeout);\n };\n }, [isPending]);\n\n return (\n <RACButton\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n isDisabled: renderProps.isDisabled || isProgressVisible,\n variant,\n fillStyle,\n size,\n staticColor,\n isStaticColor: !!staticColor\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({\n paddingY: '--labelPadding',\n order: 1,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({\n size: fontRelative(20),\n marginStart: '--iconMargin',\n flexShrink: 0,\n opacity: {\n default: 1,\n isProgressVisible: 0\n }\n })({isProgressVisible})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n {isPending &&\n <div\n className={style({\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translate(-50%, -50%)',\n opacity: {\n default: 0,\n isProgressVisible: 1\n }\n })({isProgressVisible, isPending})}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('button.pending')}\n size=\"S\"\n staticColor={staticColor}\n styles={style({\n size: {\n size: {\n S: 14,\n M: 18,\n L: 20,\n XL: 24\n }\n }\n })({size})} />\n </div>\n }\n </Provider>\n </RACButton>\n );\n});\n\n/**\n * A LinkButton combines the functionality of a link with the appearance of a button. Useful for allowing users to navigate to another page.\n */\nexport const LinkButton = forwardRef(function LinkButton(props: LinkButtonProps, ref: FocusableRef<HTMLAnchorElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, LinkButtonContext);\n props = useFormProps(props);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n\n return (\n <Link\n {...props}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + button({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n variant: props.variant || 'primary',\n fillStyle: props.fillStyle || 'fill',\n size: props.size || 'M',\n staticColor: props.staticColor,\n isStaticColor: !!props.staticColor,\n isPending: false\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {\n styles: style({paddingY: '--labelPadding', order: 1}),\n // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past\n 'data-rsp-slot': 'text'\n }],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </Link>\n );\n});\n"],"names":[],"version":3,"file":"Button.css.map"}
|