@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.mjs
CHANGED
|
@@ -47,60 +47,60 @@ const $067ea9f64ccd4e8e$export$1c1a176f3b9e48d3 = /*#__PURE__*/ (0, $7BBHC$creat
|
|
|
47
47
|
const $067ea9f64ccd4e8e$var$iconOnly = ':has([slot=icon]):not(:has([data-rsp-slot=text]))';
|
|
48
48
|
const $067ea9f64ccd4e8e$var$button = function anonymous(props, overrides) {
|
|
49
49
|
let rules = " .";
|
|
50
|
-
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|
|
|
50
|
+
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r)[^\s]+/g) || [];
|
|
51
51
|
rules += matches.join('');
|
|
52
|
-
let $
|
|
52
|
+
let $V = false;
|
|
53
53
|
let $q = false;
|
|
54
54
|
let $l = false;
|
|
55
55
|
for (let p of matches){
|
|
56
|
-
if (/^\s*
|
|
56
|
+
if (/^\s*V/.test(p)) $V = true;
|
|
57
57
|
if (/^\s*q/.test(p)) $q = true;
|
|
58
58
|
if (/^\s*l/.test(p)) $l = true;
|
|
59
59
|
}
|
|
60
|
-
if (props.isFocusVisible) rules += '
|
|
61
|
-
else rules += '
|
|
60
|
+
if (props.isFocusVisible) rules += ' _Mb';
|
|
61
|
+
else rules += ' _Ma';
|
|
62
62
|
rules += ' da_____M';
|
|
63
63
|
if (props.isStaticColor) rules += ' d_____G';
|
|
64
64
|
else rules += ' dx';
|
|
65
|
-
rules += '
|
|
66
|
-
rules += '
|
|
65
|
+
rules += ' _Oc';
|
|
66
|
+
rules += ' _N-3t1z';
|
|
67
67
|
if (props.staticColor === "white") rules += ' -_1de2x0q_b-b';
|
|
68
68
|
else if (props.staticColor === "black") rules += ' -_1de2x0q_b-c';
|
|
69
|
-
if (!$
|
|
70
|
-
rules += '
|
|
71
|
-
rules += '
|
|
72
|
-
rules += ' _1d';
|
|
69
|
+
if (!$V) rules += ' Vc';
|
|
70
|
+
rules += ' _0d';
|
|
71
|
+
rules += ' _2-soocicc';
|
|
73
72
|
rules += ' _2d';
|
|
74
|
-
rules += '
|
|
73
|
+
rules += ' _3d';
|
|
74
|
+
rules += ' _ka';
|
|
75
75
|
rules += ' jbH';
|
|
76
76
|
rules += ' jG';
|
|
77
|
-
rules += '
|
|
78
|
-
rules += '
|
|
79
|
-
rules += '
|
|
80
|
-
rules += '
|
|
81
|
-
rules += '
|
|
82
|
-
rules += '
|
|
83
|
-
rules += '
|
|
84
|
-
rules += '
|
|
77
|
+
rules += ' _d-bc1l9oh';
|
|
78
|
+
rules += ' _d-1uotwbwg';
|
|
79
|
+
rules += ' _d-eo0c6sf';
|
|
80
|
+
rules += ' _d-enzzrge';
|
|
81
|
+
rules += ' _d-enzykdd';
|
|
82
|
+
rules += ' _d-enzwzjc';
|
|
83
|
+
rules += ' _d-enzrfpb';
|
|
84
|
+
rules += ' _da';
|
|
85
85
|
if (props.size === "XL") {
|
|
86
|
-
rules += '
|
|
87
|
-
rules += '
|
|
86
|
+
rules += ' _ebj';
|
|
87
|
+
rules += ' _ei';
|
|
88
88
|
} else if (props.size === "L") {
|
|
89
|
-
rules += '
|
|
90
|
-
rules += '
|
|
89
|
+
rules += ' _ebh';
|
|
90
|
+
rules += ' _eg';
|
|
91
91
|
} else if (props.size === "S") {
|
|
92
|
-
rules += '
|
|
93
|
-
rules += '
|
|
92
|
+
rules += ' _ebd';
|
|
93
|
+
rules += ' _ec';
|
|
94
94
|
} else if (props.size === "XS") {
|
|
95
|
-
rules += '
|
|
96
|
-
rules += '
|
|
95
|
+
rules += ' _ebb';
|
|
96
|
+
rules += ' _ea';
|
|
97
97
|
} else {
|
|
98
|
-
rules += '
|
|
99
|
-
rules += '
|
|
98
|
+
rules += ' _ebf';
|
|
99
|
+
rules += ' _ee';
|
|
100
100
|
}
|
|
101
|
-
rules += '
|
|
102
|
-
rules += '
|
|
103
|
-
rules += '
|
|
101
|
+
rules += ' _fd';
|
|
102
|
+
rules += ' _g-1x99dlob';
|
|
103
|
+
rules += ' _ga';
|
|
104
104
|
if (props.fillStyle === "outline") {
|
|
105
105
|
if (props.isDisabled) rules += ' aa_____O';
|
|
106
106
|
else rules += ' aa_____K';
|
|
@@ -152,7 +152,7 @@ const $067ea9f64ccd4e8e$var$button = function anonymous(props, overrides) {
|
|
|
152
152
|
else rules += ' an';
|
|
153
153
|
} else if (props.variant === "primary") rules += ' ad';
|
|
154
154
|
}
|
|
155
|
-
rules += '
|
|
155
|
+
rules += ' __Ea';
|
|
156
156
|
rules += ' o-375tou';
|
|
157
157
|
if (!$q) {
|
|
158
158
|
if (props.size === "XL") rules += ' q-soocicj';
|
|
@@ -161,23 +161,23 @@ const $067ea9f64ccd4e8e$var$button = function anonymous(props, overrides) {
|
|
|
161
161
|
else if (props.size === "XS") rules += ' q-soocicg';
|
|
162
162
|
else rules += ' q-soocicf';
|
|
163
163
|
}
|
|
164
|
-
rules += ' _vg';
|
|
165
164
|
rules += ' _wg';
|
|
166
165
|
rules += ' _xg';
|
|
167
166
|
rules += ' _yg';
|
|
168
|
-
rules += '
|
|
167
|
+
rules += ' _zg';
|
|
168
|
+
rules += ' __oa';
|
|
169
169
|
if (!$l) rules += ' le';
|
|
170
|
-
rules += '
|
|
170
|
+
rules += ' _md';
|
|
171
171
|
rules += ' C-soocica';
|
|
172
172
|
rules += ' CJ';
|
|
173
173
|
rules += ' D-soocica';
|
|
174
174
|
rules += ' DJ';
|
|
175
175
|
rules += ' Ea';
|
|
176
176
|
rules += ' Fa';
|
|
177
|
-
rules += '
|
|
178
|
-
rules += '
|
|
179
|
-
rules += '
|
|
180
|
-
rules += '
|
|
177
|
+
rules += ' _c-soocicb';
|
|
178
|
+
rules += ' _Pa';
|
|
179
|
+
rules += ' _R-375x7f';
|
|
180
|
+
rules += ' _Sa';
|
|
181
181
|
rules += ' wa';
|
|
182
182
|
rules += ' u-375tp0';
|
|
183
183
|
rules += ' v-375tp1';
|
|
@@ -220,24 +220,23 @@ const $067ea9f64ccd4e8e$var$button = function anonymous(props, overrides) {
|
|
|
220
220
|
else if (props.isHovered) rules += ' co';
|
|
221
221
|
else rules += ' cn';
|
|
222
222
|
}
|
|
223
|
-
rules += '
|
|
224
|
-
if (props.
|
|
225
|
-
else if (props.isDisabled) rules += ' _B-yknrp1';
|
|
223
|
+
rules += ' _Ca-yknrp1';
|
|
224
|
+
if (props.isDisabled) rules += ' _C-yknrp1';
|
|
226
225
|
else if (props.variant === "genai") {
|
|
227
|
-
if (props.isFocusVisible) rules += '
|
|
228
|
-
else if (props.isPressed) rules += '
|
|
229
|
-
else if (props.isHovered) rules += '
|
|
230
|
-
else rules += '
|
|
226
|
+
if (props.isFocusVisible) rules += ' _C-1gcd5pl';
|
|
227
|
+
else if (props.isPressed) rules += ' _C-1gcd5pl';
|
|
228
|
+
else if (props.isHovered) rules += ' _C-1gcd5pl';
|
|
229
|
+
else rules += ' _C-u0nzys';
|
|
231
230
|
} else if (props.variant === "premium") {
|
|
232
|
-
if (props.isFocusVisible) rules += '
|
|
233
|
-
else if (props.isPressed) rules += '
|
|
234
|
-
else if (props.isHovered) rules += '
|
|
235
|
-
else rules += '
|
|
231
|
+
if (props.isFocusVisible) rules += ' _C-2xhv0x';
|
|
232
|
+
else if (props.isPressed) rules += ' _C-2xhv0x';
|
|
233
|
+
else if (props.isHovered) rules += ' _C-2xhv0x';
|
|
234
|
+
else rules += ' _C-riuwfd';
|
|
236
235
|
}
|
|
237
236
|
rules += ' b-375toh';
|
|
238
237
|
rules += ' -rwx0fg_e-b';
|
|
239
|
-
rules += '
|
|
240
|
-
rules += '
|
|
238
|
+
rules += ' _Ab';
|
|
239
|
+
rules += ' __S-yksgrp';
|
|
241
240
|
if (props.size === "XL") rules += ' -_375tou_o-j';
|
|
242
241
|
else if (props.size === "L") rules += ' -_375tou_o-i';
|
|
243
242
|
else if (props.size === "S") rules += ' -_375tou_o-h';
|
|
@@ -259,17 +258,20 @@ const $067ea9f64ccd4e8e$var$button = function anonymous(props, overrides) {
|
|
|
259
258
|
}
|
|
260
259
|
if (props.isStaticColor) {
|
|
261
260
|
if (props.fillStyle === "outline") {
|
|
262
|
-
if (props.isDisabled)
|
|
263
|
-
|
|
261
|
+
if (props.isDisabled) {
|
|
262
|
+
if (props.variant === "genai") rules += ' -_375toh_b-_____x';
|
|
263
|
+
else if (props.variant === "premium") rules += ' -_375toh_b-_____x';
|
|
264
|
+
else rules += ' -_375toh_b-a';
|
|
265
|
+
} else if (props.isFocusVisible) rules += ' -_375toh_b-_____x';
|
|
264
266
|
else if (props.isPressed) rules += ' -_375toh_b-_____x';
|
|
265
267
|
else if (props.isHovered) rules += ' -_375toh_b-_____x';
|
|
266
|
-
else if (props.variant === "genai") rules += ' -_375toh_b-
|
|
267
|
-
else if (props.variant === "premium") rules += ' -_375toh_b-
|
|
268
|
+
else if (props.variant === "genai") rules += ' -_375toh_b-_____x';
|
|
269
|
+
else if (props.variant === "premium") rules += ' -_375toh_b-_____x';
|
|
268
270
|
else rules += ' -_375toh_b-a';
|
|
269
271
|
} else if (props.fillStyle === "fill") {
|
|
270
272
|
if (props.isDisabled) rules += ' -_375toh_b-_____x';
|
|
271
|
-
else if (props.variant === "genai") rules += ' -_375toh_b-
|
|
272
|
-
else if (props.variant === "premium") rules += ' -_375toh_b-
|
|
273
|
+
else if (props.variant === "genai") rules += ' -_375toh_b-_____x';
|
|
274
|
+
else if (props.variant === "premium") rules += ' -_375toh_b-_____x';
|
|
273
275
|
else if (props.variant === "secondary") {
|
|
274
276
|
if (props.isPressed) rules += ' -_375toh_b-_____y';
|
|
275
277
|
else if (props.isFocusVisible) rules += ' -_375toh_b-_____y';
|
|
@@ -283,8 +285,11 @@ const $067ea9f64ccd4e8e$var$button = function anonymous(props, overrides) {
|
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
287
|
} else if (props.fillStyle === "outline") {
|
|
286
|
-
if (props.isDisabled)
|
|
287
|
-
|
|
288
|
+
if (props.isDisabled) {
|
|
289
|
+
if (props.variant === "genai") rules += ' -_375toh_b-g';
|
|
290
|
+
else if (props.variant === "premium") rules += ' -_375toh_b-g';
|
|
291
|
+
else rules += ' -_375toh_b-a';
|
|
292
|
+
} else if (props.isFocusVisible) rules += ' -_375toh_b-g';
|
|
288
293
|
else if (props.isPressed) rules += ' -_375toh_b-g';
|
|
289
294
|
else if (props.isHovered) rules += ' -_375toh_b-g';
|
|
290
295
|
else if (props.variant === "genai") rules += ' -_375toh_b-g';
|
|
@@ -369,9 +374,9 @@ const $067ea9f64ccd4e8e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $7BBHC$forwa
|
|
|
369
374
|
let rules = " .";
|
|
370
375
|
rules += ' E-1gogtue';
|
|
371
376
|
rules += ' F-1gogtue';
|
|
372
|
-
rules += '
|
|
373
|
-
if (props.isProgressVisible) rules += '
|
|
374
|
-
else rules += '
|
|
377
|
+
rules += ' __B-3t1y';
|
|
378
|
+
if (props.isProgressVisible) rules += ' _L-3t1x';
|
|
379
|
+
else rules += ' _L-3t1y';
|
|
375
380
|
return rules;
|
|
376
381
|
}({
|
|
377
382
|
isProgressVisible: isProgressVisible
|
|
@@ -385,16 +390,16 @@ const $067ea9f64ccd4e8e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $7BBHC$forwa
|
|
|
385
390
|
{
|
|
386
391
|
render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
|
|
387
392
|
slot: 'icon',
|
|
388
|
-
styles: " .
|
|
393
|
+
styles: " . __B-3t1x"
|
|
389
394
|
}),
|
|
390
395
|
styles: function anonymous(props) {
|
|
391
396
|
let rules = " .";
|
|
392
397
|
rules += ' l-1sthc3k';
|
|
393
398
|
rules += ' k-1sthc3k';
|
|
394
399
|
rules += ' y-oelgqu';
|
|
395
|
-
rules += '
|
|
396
|
-
if (props.isProgressVisible) rules += '
|
|
397
|
-
else rules += '
|
|
400
|
+
rules += ' _9-3t1x';
|
|
401
|
+
if (props.isProgressVisible) rules += ' _L-3t1x';
|
|
402
|
+
else rules += ' _L-3t1y';
|
|
398
403
|
return rules;
|
|
399
404
|
}({
|
|
400
405
|
isProgressVisible: isProgressVisible
|
|
@@ -409,12 +414,12 @@ const $067ea9f64ccd4e8e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $7BBHC$forwa
|
|
|
409
414
|
isPending && /*#__PURE__*/ (0, $7BBHC$jsx)("div", {
|
|
410
415
|
className: function anonymous(props) {
|
|
411
416
|
let rules = " .";
|
|
412
|
-
rules += '
|
|
413
|
-
rules += ' X-3760fj';
|
|
417
|
+
rules += ' Va';
|
|
414
418
|
rules += ' Y-3760fj';
|
|
415
|
-
rules += '
|
|
416
|
-
|
|
417
|
-
|
|
419
|
+
rules += ' Z-3760fj';
|
|
420
|
+
rules += ' U-1tktoou';
|
|
421
|
+
if (props.isProgressVisible) rules += ' _L-3t1y';
|
|
422
|
+
else rules += ' _L-3t1x';
|
|
418
423
|
return rules;
|
|
419
424
|
}({
|
|
420
425
|
isProgressVisible: isProgressVisible,
|
|
@@ -474,7 +479,7 @@ const $067ea9f64ccd4e8e$export$29d11c0fe2fc51d8 = /*#__PURE__*/ (0, $7BBHC$forwa
|
|
|
474
479
|
[
|
|
475
480
|
(0, $8e847109a6ab556d$export$9afb8bc826b033ea),
|
|
476
481
|
{
|
|
477
|
-
styles: " . E-1gogtue F-1gogtue
|
|
482
|
+
styles: " . E-1gogtue F-1gogtue __B-3t1y",
|
|
478
483
|
// @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past
|
|
479
484
|
'data-rsp-slot': 'text'
|
|
480
485
|
}
|
|
@@ -484,9 +489,9 @@ const $067ea9f64ccd4e8e$export$29d11c0fe2fc51d8 = /*#__PURE__*/ (0, $7BBHC$forwa
|
|
|
484
489
|
{
|
|
485
490
|
render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
|
|
486
491
|
slot: 'icon',
|
|
487
|
-
styles: " .
|
|
492
|
+
styles: " . __B-3t1x"
|
|
488
493
|
}),
|
|
489
|
-
styles: " . l-1sthc3k k-1sthc3k y-oelgqu
|
|
494
|
+
styles: " . l-1sthc3k k-1sthc3k y-oelgqu _9-3t1x"
|
|
490
495
|
}
|
|
491
496
|
]
|
|
492
497
|
],
|
package/dist/Button.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqDM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAmE;AACrG,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAmE;AAEhH,MAAM,iCAAW;AACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;gBACnE,SAAS,MAAM,OAAO,IAAI;gBAC1B,WAAW,MAAM,SAAS,IAAI;gBAC9B,MAAM,MAAM,IAAI,IAAI;gBACpB,aAAa,MAAM,WAAW;gBAC9B,eAAe,CAAC,CAAC,MAAM,WAAW;gBAClC,WAAW;YACb,GAAG,MAAM,MAAM;kBACf,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,yCAAc;oBAAG;iBAAK;gBACvB;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,MAAM;wBACN,kHAAkH;wBAClH,iBAAiB;oBACnB;iBAAE;gBACF;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;4BAAC,MAAM;4BAAQ,MAAM;wBAAmB;wBAC/D,MAAM;oBACR;iBAAE;aACH;sBACA,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0BAAG,MAAM,QAAQ;iBAAW,MAAM,QAAQ;;;AAI5F","sources":["packages/@react-spectrum/s2/src/Button.tsx"],"sourcesContent":["/*\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.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAqDM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAmE;AACrG,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAmE;AAEhH,MAAM,iCAAW;AACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4OC,MAAM,0DAAS,CAAA,GAAA,iBAAS,EAAE,SAAS,OAAO,MAAkB,EAAE,GAAoC;IACvG,CAAC,QAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,QAAO,KAAK;IACnD,SAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAChE,IAAI,aACF,SAAS,WACT,UAAU,sBACV,YAAY,cACZ,OAAO,kBACP,WAAW,EACZ,GAAG;IACJ,IAAI,SAAS,CAAA,GA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AAE;gBACF;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;4BAAC,MAAM;4BAAQ,MAAM;wBAAmB;wBAC/D,MAAM;oBACR;iBAAE;aACH;sBACA,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0BAAG,MAAM,QAAQ;iBAAW,MAAM,QAAQ;;;AAI5F","sources":["packages/@react-spectrum/s2/src/Button.tsx"],"sourcesContent":["/*\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.mjs.map"}
|
package/dist/ButtonGroup.cjs
CHANGED
|
@@ -34,12 +34,12 @@ $parcel$export(module.exports, "ButtonGroup", () => $e1016b8947dbadb8$export$69b
|
|
|
34
34
|
const $e1016b8947dbadb8$export$4c574c91bb0be0e2 = /*#__PURE__*/ (0, $5rFNy$react.createContext)({});
|
|
35
35
|
const $e1016b8947dbadb8$var$buttongroup = function anonymous(props, overrides) {
|
|
36
36
|
let rules = " .";
|
|
37
|
-
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|
|
|
37
|
+
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r)[^\s]+/g) || [];
|
|
38
38
|
rules += matches.join('');
|
|
39
|
-
let $
|
|
40
|
-
for (let p of matches)if (/^\s*
|
|
41
|
-
rules += '
|
|
42
|
-
if (!$
|
|
39
|
+
let $V = false;
|
|
40
|
+
for (let p of matches)if (/^\s*V/.test(p)) $V = true;
|
|
41
|
+
rules += ' _0e';
|
|
42
|
+
if (!$V) rules += ' Vc';
|
|
43
43
|
if (props.size === "XL") rules += ' ie';
|
|
44
44
|
else if (props.size === "L") rules += ' ie';
|
|
45
45
|
else if (props.size === "M") rules += ' ie';
|
|
@@ -48,17 +48,17 @@ const $e1016b8947dbadb8$var$buttongroup = function anonymous(props, overrides) {
|
|
|
48
48
|
else if (props.size === "L") rules += ' je';
|
|
49
49
|
else if (props.size === "M") rules += ' je';
|
|
50
50
|
else if (props.size === "S") rules += ' jd';
|
|
51
|
-
if (props.orientation === "vertical") rules += '
|
|
52
|
-
else rules += '
|
|
51
|
+
if (props.orientation === "vertical") rules += ' _7b';
|
|
52
|
+
else rules += ' _7a';
|
|
53
53
|
if (props.orientation === "vertical") {
|
|
54
|
-
if (props.align === "center") rules += '
|
|
55
|
-
else if (props.align === "end") rules += '
|
|
56
|
-
else rules += '
|
|
57
|
-
} else rules += '
|
|
54
|
+
if (props.align === "center") rules += ' _2c';
|
|
55
|
+
else if (props.align === "end") rules += ' _2b';
|
|
56
|
+
else rules += ' _2a';
|
|
57
|
+
} else rules += ' _2c';
|
|
58
58
|
if (props.orientation === "vertical") {
|
|
59
|
-
if (props.align === "center") rules += '
|
|
60
|
-
else if (props.align === "end") rules += '
|
|
61
|
-
else rules += '
|
|
59
|
+
if (props.align === "center") rules += ' _3d';
|
|
60
|
+
else if (props.align === "end") rules += ' _3c';
|
|
61
|
+
else rules += ' _3b';
|
|
62
62
|
}
|
|
63
63
|
return rules;
|
|
64
64
|
};
|
|
@@ -112,7 +112,7 @@ const $e1016b8947dbadb8$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $5rFNy$react
|
|
|
112
112
|
});
|
|
113
113
|
if (props.isHidden) return null;
|
|
114
114
|
let context = {
|
|
115
|
-
styles: " .
|
|
115
|
+
styles: " . _9-3t1x",
|
|
116
116
|
size: size,
|
|
117
117
|
isDisabled: isDisabled
|
|
118
118
|
};
|
package/dist/ButtonGroup.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
@layer _.a {
|
|
2
|
-
.
|
|
2
|
+
._0e {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
6
|
+
.Vc {
|
|
7
7
|
position: relative;
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -23,39 +23,39 @@
|
|
|
23
23
|
column-gap: .75rem;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
._7a {
|
|
27
27
|
flex-direction: row;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.
|
|
30
|
+
._7b {
|
|
31
31
|
flex-direction: column;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
34
|
+
._2a {
|
|
35
35
|
align-items: start;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.
|
|
38
|
+
._2b {
|
|
39
39
|
align-items: end;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.
|
|
42
|
+
._2c {
|
|
43
43
|
align-items: center;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
._3b {
|
|
47
47
|
justify-content: start;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.
|
|
50
|
+
._3c {
|
|
51
51
|
justify-content: end;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.
|
|
54
|
+
._3d {
|
|
55
55
|
justify-content: center;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.
|
|
58
|
+
._9-3t1x {
|
|
59
59
|
flex-shrink: 0;
|
|
60
60
|
}
|
|
61
61
|
}
|
package/dist/ButtonGroup.mjs
CHANGED
|
@@ -27,12 +27,12 @@ import {useValueEffect as $bnJX2$useValueEffect, useLayoutEffect as $bnJX2$useLa
|
|
|
27
27
|
const $472eaa9a9b344b9a$export$4c574c91bb0be0e2 = /*#__PURE__*/ (0, $bnJX2$createContext)({});
|
|
28
28
|
const $472eaa9a9b344b9a$var$buttongroup = function anonymous(props, overrides) {
|
|
29
29
|
let rules = " .";
|
|
30
|
-
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|
|
|
30
|
+
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|__a|_9|h|_6|_5|__B|__d|__e|__b|__c|V|__R|Y|_a|W|X|l|q|r)[^\s]+/g) || [];
|
|
31
31
|
rules += matches.join('');
|
|
32
|
-
let $
|
|
33
|
-
for (let p of matches)if (/^\s*
|
|
34
|
-
rules += '
|
|
35
|
-
if (!$
|
|
32
|
+
let $V = false;
|
|
33
|
+
for (let p of matches)if (/^\s*V/.test(p)) $V = true;
|
|
34
|
+
rules += ' _0e';
|
|
35
|
+
if (!$V) rules += ' Vc';
|
|
36
36
|
if (props.size === "XL") rules += ' ie';
|
|
37
37
|
else if (props.size === "L") rules += ' ie';
|
|
38
38
|
else if (props.size === "M") rules += ' ie';
|
|
@@ -41,17 +41,17 @@ const $472eaa9a9b344b9a$var$buttongroup = function anonymous(props, overrides) {
|
|
|
41
41
|
else if (props.size === "L") rules += ' je';
|
|
42
42
|
else if (props.size === "M") rules += ' je';
|
|
43
43
|
else if (props.size === "S") rules += ' jd';
|
|
44
|
-
if (props.orientation === "vertical") rules += '
|
|
45
|
-
else rules += '
|
|
44
|
+
if (props.orientation === "vertical") rules += ' _7b';
|
|
45
|
+
else rules += ' _7a';
|
|
46
46
|
if (props.orientation === "vertical") {
|
|
47
|
-
if (props.align === "center") rules += '
|
|
48
|
-
else if (props.align === "end") rules += '
|
|
49
|
-
else rules += '
|
|
50
|
-
} else rules += '
|
|
47
|
+
if (props.align === "center") rules += ' _2c';
|
|
48
|
+
else if (props.align === "end") rules += ' _2b';
|
|
49
|
+
else rules += ' _2a';
|
|
50
|
+
} else rules += ' _2c';
|
|
51
51
|
if (props.orientation === "vertical") {
|
|
52
|
-
if (props.align === "center") rules += '
|
|
53
|
-
else if (props.align === "end") rules += '
|
|
54
|
-
else rules += '
|
|
52
|
+
if (props.align === "center") rules += ' _3d';
|
|
53
|
+
else if (props.align === "end") rules += ' _3c';
|
|
54
|
+
else rules += ' _3b';
|
|
55
55
|
}
|
|
56
56
|
return rules;
|
|
57
57
|
};
|
|
@@ -105,7 +105,7 @@ const $472eaa9a9b344b9a$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $bnJX2$forwa
|
|
|
105
105
|
});
|
|
106
106
|
if (props.isHidden) return null;
|
|
107
107
|
let context = {
|
|
108
|
-
styles: " .
|
|
108
|
+
styles: " . _9-3t1x",
|
|
109
109
|
size: size,
|
|
110
110
|
isDisabled: isDisabled
|
|
111
111
|
};
|