@react-spectrum/s2 3.0.0-nightly-4baa1b08e-241029 → 3.0.0-nightly-07431f4b1-241030
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/ActionButton.cjs +10 -32
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +20 -60
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +10 -32
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/Avatar.cjs +2 -4
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css +4 -16
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs +2 -4
- package/dist/Avatar.mjs.map +1 -1
- package/dist/Badge.cjs +5 -16
- package/dist/Badge.cjs.map +1 -1
- package/dist/Badge.css +10 -30
- package/dist/Badge.css.map +1 -1
- package/dist/Badge.mjs +5 -16
- package/dist/Badge.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs +12 -41
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css +38 -86
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +12 -41
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +19 -59
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +37 -113
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +19 -59
- package/dist/Button.mjs.map +1 -1
- package/dist/Card.cjs +27 -67
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +42 -117
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +27 -67
- package/dist/Card.mjs.map +1 -1
- package/dist/Checkbox.cjs +9 -27
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css +17 -49
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs +9 -27
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs +5 -16
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css +10 -30
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs +5 -16
- package/dist/CheckboxGroup.mjs.map +1 -1
- package/dist/ClearButton.cjs +6 -17
- package/dist/ClearButton.cjs.map +1 -1
- package/dist/ClearButton.css +11 -35
- package/dist/ClearButton.css.map +1 -1
- package/dist/ClearButton.mjs +6 -17
- package/dist/ClearButton.mjs.map +1 -1
- package/dist/CloseButton.cjs +10 -32
- package/dist/CloseButton.cjs.map +1 -1
- package/dist/CloseButton.css +20 -64
- package/dist/CloseButton.css.map +1 -1
- package/dist/CloseButton.mjs +10 -32
- package/dist/CloseButton.mjs.map +1 -1
- package/dist/ColorArea.cjs +4 -16
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css +8 -28
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +4 -16
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +5 -16
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css +10 -30
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +5 -16
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs +5 -15
- package/dist/ColorHandle.cjs.map +1 -1
- package/dist/ColorHandle.css +10 -30
- package/dist/ColorHandle.css.map +1 -1
- package/dist/ColorHandle.mjs +5 -15
- package/dist/ColorHandle.mjs.map +1 -1
- package/dist/ColorSlider.cjs +6 -17
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +34 -50
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +6 -17
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +8 -26
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css +16 -52
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs +8 -26
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +6 -16
- package/dist/ColorSwatchPicker.cjs.map +1 -1
- package/dist/ColorSwatchPicker.css +8 -28
- package/dist/ColorSwatchPicker.css.map +1 -1
- package/dist/ColorSwatchPicker.mjs +6 -16
- package/dist/ColorSwatchPicker.mjs.map +1 -1
- package/dist/ComboBox.cjs +22 -71
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +64 -152
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +22 -71
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +1 -1
- package/dist/ContextualHelp.css +2 -6
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +1 -1
- package/dist/Dialog.cjs +2 -2
- package/dist/Dialog.css +2 -2
- package/dist/Dialog.mjs +2 -2
- package/dist/Disclosure.cjs +22 -61
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +47 -91
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +22 -61
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/DropZone.cjs +2 -4
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +4 -16
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +2 -4
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +16 -47
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +31 -95
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +16 -47
- package/dist/Field.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +6 -20
- package/dist/IllustratedMessage.cjs.map +1 -1
- package/dist/IllustratedMessage.css +10 -24
- package/dist/IllustratedMessage.css.map +1 -1
- package/dist/IllustratedMessage.mjs +6 -20
- package/dist/IllustratedMessage.mjs.map +1 -1
- package/dist/Image.cjs +2 -2
- package/dist/Image.css +2 -2
- package/dist/Image.mjs +2 -2
- package/dist/InlineAlert.cjs +2 -5
- package/dist/InlineAlert.cjs.map +1 -1
- package/dist/InlineAlert.css +11 -15
- package/dist/InlineAlert.css.map +1 -1
- package/dist/InlineAlert.mjs +2 -5
- package/dist/InlineAlert.mjs.map +1 -1
- package/dist/Menu.cjs +22 -67
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +32 -96
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +22 -67
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +22 -68
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css +63 -139
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +22 -68
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +2 -2
- package/dist/Modal.css +2 -2
- package/dist/Modal.mjs +2 -2
- package/dist/NumberField.cjs +23 -71
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +63 -146
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +23 -71
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +23 -67
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +50 -130
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +23 -67
- package/dist/Picker.mjs.map +1 -1
- package/dist/ProgressBar.cjs +23 -69
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css +64 -140
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +23 -69
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +6 -20
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css +12 -40
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +6 -20
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/Provider.css +7 -0
- package/dist/Provider.css.map +1 -1
- package/dist/Radio.cjs +8 -26
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css +16 -48
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +8 -26
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs +5 -16
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css +10 -30
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs +5 -16
- package/dist/RadioGroup.mjs.map +1 -1
- package/dist/SearchField.cjs +5 -16
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css +10 -30
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +5 -16
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +8 -14
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css +9 -29
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +8 -14
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/Slider.cjs +63 -196
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css +61 -181
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs +63 -196
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +9 -27
- package/dist/StatusLight.cjs.map +1 -1
- package/dist/StatusLight.css +17 -49
- package/dist/StatusLight.css.map +1 -1
- package/dist/StatusLight.mjs +9 -27
- package/dist/StatusLight.mjs.map +1 -1
- package/dist/Switch.cjs +6 -15
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css +10 -26
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs +6 -15
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs +42 -86
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +65 -129
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +42 -86
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +4 -15
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +18 -34
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +4 -15
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TagGroup.cjs +14 -37
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +23 -67
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +14 -37
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +11 -34
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +22 -66
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +11 -34
- package/dist/TextField.mjs.map +1 -1
- package/dist/Tooltip.cjs +2 -4
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +4 -12
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +2 -4
- package/dist/Tooltip.mjs.map +1 -1
- package/package.json +17 -17
- package/page.css +7 -0
- package/src/page.macro.ts +11 -0
- package/style/dist/spectrum-theme.cjs +2 -8
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +2 -8
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/types.d.ts +1 -4
- package/style/dist/types.d.ts.map +1 -1
- package/style/spectrum-theme.ts +4 -4
package/dist/Slider.mjs
CHANGED
|
@@ -86,7 +86,7 @@ const $8128d8480e67c400$var$labelContainer = function anonymous(props) {
|
|
|
86
86
|
rules += ' __b-4e9m05';
|
|
87
87
|
rules += ' __c-4e9m05';
|
|
88
88
|
rules += ' __d-4e9m05';
|
|
89
|
-
rules += '
|
|
89
|
+
rules += ' lG';
|
|
90
90
|
if (props.labelPosition === "top") rules += ' __j-qdp51y';
|
|
91
91
|
if (props.labelPosition === "top") rules += ' __h-u2tns7';
|
|
92
92
|
if (props.labelPosition === "side") {
|
|
@@ -119,50 +119,23 @@ let $8128d8480e67c400$export$6b2a7d5132615086 = function anonymous(props) {
|
|
|
119
119
|
rules += ' __c-4ka10a';
|
|
120
120
|
rules += ' __d-4ka10a';
|
|
121
121
|
rules += ' Uc';
|
|
122
|
-
rules += '
|
|
123
|
-
if (props.size === "XL")
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
rules += ' kbu';
|
|
128
|
-
rules += ' kr';
|
|
129
|
-
} else if (props.size === "M") {
|
|
130
|
-
rules += ' kbr';
|
|
131
|
-
rules += ' kq';
|
|
132
|
-
} else if (props.size === "S") {
|
|
133
|
-
rules += ' kbn';
|
|
134
|
-
rules += ' km';
|
|
135
|
-
}
|
|
122
|
+
rules += ' lG';
|
|
123
|
+
if (props.size === "XL") rules += ' kn';
|
|
124
|
+
else if (props.size === "L") rules += ' kl';
|
|
125
|
+
else if (props.size === "M") rules += ' kj';
|
|
126
|
+
else if (props.size === "S") rules += ' kh';
|
|
136
127
|
return rules;
|
|
137
128
|
};
|
|
138
129
|
let $8128d8480e67c400$export$7814bee2738c4c3 = function anonymous(props) {
|
|
139
130
|
let rules = " .";
|
|
140
|
-
if (props.size === "XL")
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
rules += ' lk';
|
|
149
|
-
} else if (props.size === "S") {
|
|
150
|
-
rules += ' lb-1nxaedl';
|
|
151
|
-
rules += ' l-1ytbuww';
|
|
152
|
-
}
|
|
153
|
-
if (props.size === "XL") {
|
|
154
|
-
rules += ' kbn';
|
|
155
|
-
rules += ' km';
|
|
156
|
-
} else if (props.size === "L") {
|
|
157
|
-
rules += ' kb-1u8pit0';
|
|
158
|
-
rules += ' k-16cidj';
|
|
159
|
-
} else if (props.size === "M") {
|
|
160
|
-
rules += ' kbl';
|
|
161
|
-
rules += ' kk';
|
|
162
|
-
} else if (props.size === "S") {
|
|
163
|
-
rules += ' kb-1nxaedl';
|
|
164
|
-
rules += ' k-1ytbuww';
|
|
165
|
-
}
|
|
131
|
+
if (props.size === "XL") rules += ' lh';
|
|
132
|
+
else if (props.size === "L") rules += ' l-10sr2ub';
|
|
133
|
+
else if (props.size === "M") rules += ' lg';
|
|
134
|
+
else if (props.size === "S") rules += ' l-9ed7ss';
|
|
135
|
+
if (props.size === "XL") rules += ' kh';
|
|
136
|
+
else if (props.size === "L") rules += ' k-10sr2ub';
|
|
137
|
+
else if (props.size === "M") rules += ' kg';
|
|
138
|
+
else if (props.size === "S") rules += ' k-9ed7ss';
|
|
166
139
|
rules += ' _Zb';
|
|
167
140
|
rules += ' Ua';
|
|
168
141
|
rules += ' X-3760fj';
|
|
@@ -171,62 +144,26 @@ let $8128d8480e67c400$export$7814bee2738c4c3 = function anonymous(props) {
|
|
|
171
144
|
let $8128d8480e67c400$export$f120a3c6038107a5 = function anonymous(props) {
|
|
172
145
|
let rules = " .";
|
|
173
146
|
if (props.thumbStyle === "precise") {
|
|
174
|
-
if (props.size === "XL")
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
rules += ' lbn';
|
|
179
|
-
rules += ' lm';
|
|
180
|
-
} else if (props.size === "M") {
|
|
181
|
-
rules += ' lb-1u8pit0';
|
|
182
|
-
rules += ' l-16cidj';
|
|
183
|
-
} else if (props.size === "S") {
|
|
184
|
-
rules += ' lbl';
|
|
185
|
-
rules += ' lk';
|
|
186
|
-
}
|
|
147
|
+
if (props.size === "XL") rules += ' l-z22p4x';
|
|
148
|
+
else if (props.size === "L") rules += ' lh';
|
|
149
|
+
else if (props.size === "M") rules += ' l-10sr2ub';
|
|
150
|
+
else if (props.size === "S") rules += ' lg';
|
|
187
151
|
} else if (props.thumbStyle === "default") {
|
|
188
|
-
if (props.size === "XL")
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
rules += ' lb-1u8pit0';
|
|
193
|
-
rules += ' l-16cidj';
|
|
194
|
-
} else if (props.size === "M") {
|
|
195
|
-
rules += ' lbl';
|
|
196
|
-
rules += ' lk';
|
|
197
|
-
} else if (props.size === "S") {
|
|
198
|
-
rules += ' lb-1nxaedl';
|
|
199
|
-
rules += ' l-1ytbuww';
|
|
200
|
-
}
|
|
152
|
+
if (props.size === "XL") rules += ' lh';
|
|
153
|
+
else if (props.size === "L") rules += ' l-10sr2ub';
|
|
154
|
+
else if (props.size === "M") rules += ' lg';
|
|
155
|
+
else if (props.size === "S") rules += ' l-9ed7ss';
|
|
201
156
|
}
|
|
202
157
|
if (props.thumbStyle === "precise") {
|
|
203
|
-
if (props.size === "XL")
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
rules += ' kbn';
|
|
208
|
-
rules += ' km';
|
|
209
|
-
} else if (props.size === "M") {
|
|
210
|
-
rules += ' kb-1u8pit0';
|
|
211
|
-
rules += ' k-16cidj';
|
|
212
|
-
} else if (props.size === "S") {
|
|
213
|
-
rules += ' kbl';
|
|
214
|
-
rules += ' kk';
|
|
215
|
-
}
|
|
158
|
+
if (props.size === "XL") rules += ' k-z22p4x';
|
|
159
|
+
else if (props.size === "L") rules += ' kh';
|
|
160
|
+
else if (props.size === "M") rules += ' k-10sr2ub';
|
|
161
|
+
else if (props.size === "S") rules += ' kg';
|
|
216
162
|
} else if (props.thumbStyle === "default") {
|
|
217
|
-
if (props.size === "XL")
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
rules += ' kb-1u8pit0';
|
|
222
|
-
rules += ' k-16cidj';
|
|
223
|
-
} else if (props.size === "M") {
|
|
224
|
-
rules += ' kbl';
|
|
225
|
-
rules += ' kk';
|
|
226
|
-
} else if (props.size === "S") {
|
|
227
|
-
rules += ' kb-1nxaedl';
|
|
228
|
-
rules += ' k-1ytbuww';
|
|
229
|
-
}
|
|
163
|
+
if (props.size === "XL") rules += ' kh';
|
|
164
|
+
else if (props.size === "L") rules += ' k-10sr2ub';
|
|
165
|
+
else if (props.size === "M") rules += ' kg';
|
|
166
|
+
else if (props.size === "S") rules += ' k-9ed7ss';
|
|
230
167
|
}
|
|
231
168
|
return rules;
|
|
232
169
|
};
|
|
@@ -244,52 +181,23 @@ let $8128d8480e67c400$export$becc9140d0e846f8 = function anonymous(props) {
|
|
|
244
181
|
rules += ' X-3760fj';
|
|
245
182
|
rules += ' Y-3760fj';
|
|
246
183
|
rules += ' T-s83jgi';
|
|
247
|
-
if (props.thumbStyle === "precise")
|
|
248
|
-
|
|
249
|
-
rules += '
|
|
250
|
-
|
|
251
|
-
if (props.size === "
|
|
252
|
-
|
|
253
|
-
rules += ' lm';
|
|
254
|
-
} else if (props.size === "L") {
|
|
255
|
-
rules += ' lb-1u8pit0';
|
|
256
|
-
rules += ' l-16cidj';
|
|
257
|
-
} else if (props.size === "M") {
|
|
258
|
-
rules += ' lbl';
|
|
259
|
-
rules += ' lk';
|
|
260
|
-
} else if (props.size === "S") {
|
|
261
|
-
rules += ' lb-1nxaedl';
|
|
262
|
-
rules += ' l-1ytbuww';
|
|
263
|
-
}
|
|
184
|
+
if (props.thumbStyle === "precise") rules += ' l-ve8p9e';
|
|
185
|
+
else if (props.thumbStyle === "default") {
|
|
186
|
+
if (props.size === "XL") rules += ' lh';
|
|
187
|
+
else if (props.size === "L") rules += ' l-10sr2ub';
|
|
188
|
+
else if (props.size === "M") rules += ' lg';
|
|
189
|
+
else if (props.size === "S") rules += ' l-9ed7ss';
|
|
264
190
|
}
|
|
265
191
|
if (props.thumbStyle === "precise") {
|
|
266
|
-
if (props.size === "XL")
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
rules += ' kbn';
|
|
271
|
-
rules += ' km';
|
|
272
|
-
} else if (props.size === "M") {
|
|
273
|
-
rules += ' kb-1u8pit0';
|
|
274
|
-
rules += ' k-16cidj';
|
|
275
|
-
} else if (props.size === "S") {
|
|
276
|
-
rules += ' kbl';
|
|
277
|
-
rules += ' kk';
|
|
278
|
-
}
|
|
192
|
+
if (props.size === "XL") rules += ' k-z22p4x';
|
|
193
|
+
else if (props.size === "L") rules += ' kh';
|
|
194
|
+
else if (props.size === "M") rules += ' k-10sr2ub';
|
|
195
|
+
else if (props.size === "S") rules += ' kg';
|
|
279
196
|
} else if (props.thumbStyle === "default") {
|
|
280
|
-
if (props.size === "XL")
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
rules += ' kb-1u8pit0';
|
|
285
|
-
rules += ' k-16cidj';
|
|
286
|
-
} else if (props.size === "M") {
|
|
287
|
-
rules += ' kbl';
|
|
288
|
-
rules += ' kk';
|
|
289
|
-
} else if (props.size === "S") {
|
|
290
|
-
rules += ' kb-1nxaedl';
|
|
291
|
-
rules += ' k-1ytbuww';
|
|
292
|
-
}
|
|
197
|
+
if (props.size === "XL") rules += ' kh';
|
|
198
|
+
else if (props.size === "L") rules += ' k-10sr2ub';
|
|
199
|
+
else if (props.size === "M") rules += ' kg';
|
|
200
|
+
else if (props.size === "S") rules += ' k-9ed7ss';
|
|
293
201
|
}
|
|
294
202
|
rules += ' _vf';
|
|
295
203
|
rules += ' _wf';
|
|
@@ -325,13 +233,8 @@ const $8128d8480e67c400$var$trackStyling = {
|
|
|
325
233
|
};
|
|
326
234
|
let $8128d8480e67c400$export$1e1dc99b6e2204f1 = function anonymous(props) {
|
|
327
235
|
let rules = " .";
|
|
328
|
-
if (props.trackStyle === "thick")
|
|
329
|
-
|
|
330
|
-
rules += ' kj';
|
|
331
|
-
} else if (props.trackStyle === "thin") {
|
|
332
|
-
rules += ' kbe';
|
|
333
|
-
rules += ' kd';
|
|
334
|
-
}
|
|
236
|
+
if (props.trackStyle === "thick") rules += ' kf';
|
|
237
|
+
else if (props.trackStyle === "thin") rules += ' kc';
|
|
335
238
|
rules += ' X-3760fj';
|
|
336
239
|
if (props.trackStyle === "thick") rules += ' _vb';
|
|
337
240
|
else if (props.trackStyle === "thin") rules += ' _vd';
|
|
@@ -345,7 +248,7 @@ let $8128d8480e67c400$export$1e1dc99b6e2204f1 = function anonymous(props) {
|
|
|
345
248
|
if (props.isDisabled) rules += ' bg';
|
|
346
249
|
else rules += ' bi';
|
|
347
250
|
rules += ' Q-yj8axo';
|
|
348
|
-
rules += '
|
|
251
|
+
rules += ' lG';
|
|
349
252
|
rules += ' __na';
|
|
350
253
|
rules += ' wa';
|
|
351
254
|
rules += ' u-yj94cw';
|
|
@@ -359,13 +262,8 @@ let $8128d8480e67c400$export$1e1dc99b6e2204f1 = function anonymous(props) {
|
|
|
359
262
|
};
|
|
360
263
|
let $8128d8480e67c400$export$847ceef3bc944d02 = function anonymous(props) {
|
|
361
264
|
let rules = " .";
|
|
362
|
-
if (props.trackStyle === "thick")
|
|
363
|
-
|
|
364
|
-
rules += ' kj';
|
|
365
|
-
} else if (props.trackStyle === "thin") {
|
|
366
|
-
rules += ' kbe';
|
|
367
|
-
rules += ' kd';
|
|
368
|
-
}
|
|
265
|
+
if (props.trackStyle === "thick") rules += ' kf';
|
|
266
|
+
else if (props.trackStyle === "thin") rules += ' kc';
|
|
369
267
|
rules += ' X-3760fj';
|
|
370
268
|
if (props.trackStyle === "thick") rules += ' _vb';
|
|
371
269
|
else if (props.trackStyle === "thin") rules += ' _vd';
|
|
@@ -437,22 +335,11 @@ function $8128d8480e67c400$export$9418495bb635ebde(props1) {
|
|
|
437
335
|
rules += ' _1d';
|
|
438
336
|
rules += ' _f-1x99dlob';
|
|
439
337
|
rules += ' _fa';
|
|
440
|
-
if (props.size === "XL")
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
rules += ' -aqrvqh_k-r';
|
|
446
|
-
} else if (props.size === "S") {
|
|
447
|
-
rules += ' -aqrvqh_k-bn';
|
|
448
|
-
rules += ' -aqrvqh_k-m';
|
|
449
|
-
} else if (props.size === "XS") {
|
|
450
|
-
rules += ' -aqrvqh_k-bl';
|
|
451
|
-
rules += ' -aqrvqh_k-k';
|
|
452
|
-
} else {
|
|
453
|
-
rules += ' -aqrvqh_k-br';
|
|
454
|
-
rules += ' -aqrvqh_k-q';
|
|
455
|
-
}
|
|
338
|
+
if (props.size === "XL") rules += ' -aqrvqh_k-n';
|
|
339
|
+
else if (props.size === "L") rules += ' -aqrvqh_k-l';
|
|
340
|
+
else if (props.size === "S") rules += ' -aqrvqh_k-h';
|
|
341
|
+
else if (props.size === "XS") rules += ' -aqrvqh_k-g';
|
|
342
|
+
else rules += ' -aqrvqh_k-j';
|
|
456
343
|
rules += ' -_1inj1bc_i--prjw07';
|
|
457
344
|
rules += ' je';
|
|
458
345
|
rules += ' __R-yksgrp';
|
|
@@ -528,37 +415,17 @@ function $8128d8480e67c400$export$9418495bb635ebde(props1) {
|
|
|
528
415
|
rules += ' __b-4cfph1';
|
|
529
416
|
rules += ' __c-4cfph1';
|
|
530
417
|
rules += ' __d-4cfph1';
|
|
531
|
-
if (props.size === "XL")
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
rules += ' qr';
|
|
537
|
-
} else if (props.size === "S") {
|
|
538
|
-
rules += ' qbn';
|
|
539
|
-
rules += ' qm';
|
|
540
|
-
} else if (props.size === "XS") {
|
|
541
|
-
rules += ' qbl';
|
|
542
|
-
rules += ' qk';
|
|
543
|
-
} else {
|
|
544
|
-
rules += ' qbr';
|
|
545
|
-
rules += ' qq';
|
|
546
|
-
}
|
|
418
|
+
if (props.size === "XL") rules += ' qn';
|
|
419
|
+
else if (props.size === "L") rules += ' ql';
|
|
420
|
+
else if (props.size === "S") rules += ' qh';
|
|
421
|
+
else if (props.size === "XS") rules += ' qg';
|
|
422
|
+
else rules += ' qj';
|
|
547
423
|
if (props.isQuiet) rules += ' __ma';
|
|
548
424
|
else rules += ' __m-1s8glxue';
|
|
549
|
-
if (props.size === "XL")
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
rules += ' -usygro_l-bU';
|
|
554
|
-
rules += ' -usygro_l-T';
|
|
555
|
-
} else if (props.size === "S") {
|
|
556
|
-
rules += ' -usygro_l-bQ';
|
|
557
|
-
rules += ' -usygro_l-P';
|
|
558
|
-
} else {
|
|
559
|
-
rules += ' -usygro_l-bS';
|
|
560
|
-
rules += ' -usygro_l-R';
|
|
561
|
-
}
|
|
425
|
+
if (props.size === "XL") rules += ' -usygro_l-A';
|
|
426
|
+
else if (props.size === "L") rules += ' -usygro_l-z';
|
|
427
|
+
else if (props.size === "S") rules += ' -usygro_l-x';
|
|
428
|
+
else rules += ' -usygro_l-y';
|
|
562
429
|
rules += ' m-rwozxi';
|
|
563
430
|
rules += ' _Ze';
|
|
564
431
|
rules += ' _1c';
|
package/dist/Slider.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAgE;AAEzG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBN,MAAM;;;;;;;;;;;;;;;;;AAoCN,MAAM;;;;;;;;;;;;;;;;AAqBC,IAAI;;;;;;;;;;;;;;;;;;;;;;;AAcJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDX,MAAM,qCAAe;IACnB,QAAQ;QACN,YAAY;YACV,MAAM;YACN,OAAO;QACT;IACF;IACA,KAAK;IACL,cAAc;QACZ,YAAY;YACV,MAAM;YACN,OAAO;QACT;IACF;AACF;AAEO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBJ,SAAS,0CAAwC,MAAyE;IAC/H,IAAI,cAAc,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAU;IACvC,SAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,SACF,KAAK,iBACL,gBAAgB,mBAChB,aAAa,eACb,OAAO,eACP,WAAW,aACX,WAAW,oBACX,aAAa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AAK,cAAE,UAAU,EAAC;gBAEnB,aAAa,eAAe,YAAY,CAAA,GAAA,YAAI,EAAE,YAAY,MAAM,gBAAgB,CAAC,IAAI,MAAM,gBAAgB,CAAC,MAAM,MAAM,gBAAgB,CAAC;gBAEzI,IAAI,YAAY,MAAM,eAAe,CAAC,KAAK,MAAM,eAAe,CAAC;gBACjE,IAAI,kBAAkB,YAAY;gBAClC,IAAI,SAAS,kBAAkB,MAAM,eAAe,CAAC,cAAc,MAAM,eAAe,CAAC;gBAEzF,qBACE;;sCACE,gBAAC;4BAAI,WAAW,0CAAW;4CAAC;4CAAY;4BAAU;;sCAClD,gBAAC;4BAAI,OAAO;gCAAC,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC,aAAa,IAAI,CAAC,CAAC;gCAAE,CAAC,aAAa,EAAE,CAAC,EAAE,SAAS,IAAI,CAAC,CAAC;4BAAA;4BAAG,WAAW,0CAAY;4CAAC;8CAAY;4CAAc;4BAAU;;sCACtJ,gBAAC,CAAA,GAAA,kBAAU;4BAAG,WAAW;4BAAgB,OAAO;4BAAG,MAAM,MAAM,IAAI;4BAAE,KAAK;4BAAU,OAAO,CAAC,cAAgB,CAAA,GAAA,yCAAS,EAAE,UAAU;oCAAC,WAAW;gCAAuB,GAAG;oCAAC,GAAG,WAAW;oCAAE,WAAW,YAAY,UAAU;gCAAA;sCACtN,CAAC,4BACA,gBAAC;oCAAI,WAAW,0CAAa;8CAAC;oCAAI;8CAChC,cAAA,gBAAC;wCACC,WAAW,0CAAM;4CACf,GAAG,WAAW;kDACd;wDACA;wCACF;;;;;;YAMd;;;AAIR;AAEA,IAAI,4CAAU,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Slider.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 {\n Slider as AriaSlider,\n SliderProps as AriaSliderProps,\n ContextValue,\n SliderOutput,\n SliderThumb,\n SliderTrack\n} from 'react-aria-components';\nimport {clamp} from '@react-aria/utils';\nimport {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {focusRing, size, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {mergeStyles} from '../style/runtime';\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocale, useNumberFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SliderBaseProps<T> extends Omit<AriaSliderProps<T>, 'children' | 'style' | 'className' | 'orientation'>, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, StyleProps {\n children?: ReactNode,\n /**\n * The size of the Slider.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Slider should be displayed with an emphasized style.\n */\n isEmphasized?: boolean,\n /**\n * The style of the Slider's track.\n *\n * @default 'thin'\n */\n trackStyle?: 'thin' | 'thick', // TODO: add ramp\n /**\n * The style of the Slider's thumb.\n *\n * @default 'default'\n */\n thumbStyle?: 'default' | 'precise'\n // TODO\n // isEditable?: boolean,\n}\n\nexport interface SliderProps extends Omit<SliderBaseProps<number>, 'children'>, InputDOMProps {\n /**\n * The offset from which to start the fill.\n */\n fillOffset?: number\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, FocusableRefValue<HTMLDivElement>>>(null);\n\nconst slider = style({\n font: 'control',\n alignItems: {\n labelPosition: {\n side: 'center'\n }\n },\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n },\n columnGap: {\n size: {\n S: 16,\n M: 16,\n L: 20,\n XL: 24\n },\n isInForm: 12\n }\n}, getAllowedOverrides());\n\nconst labelContainer = style({\n display: {\n labelPosition: {\n top: 'grid'\n }\n },\n gridArea: 'label',\n width: 'full',\n gridTemplateAreas: {\n labelPosition: {\n top: ['label output']\n }\n },\n gridTemplateColumns: {\n labelPosition: {\n top: [\n '1fr auto'\n ]\n }\n },\n textAlign: {\n labelPosition: {\n side: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n }\n }\n },\n '--field-gap': {\n type: 'paddingBottom',\n value: 0\n }\n});\n\nconst output = style({\n gridArea: 'output',\n textAlign: {\n labelPosition: {\n top: {\n direction: {\n ltr: 'end',\n rtl: 'start'\n }\n },\n side: {\n direction: {\n ltr: 'start',\n rtl: 'end'\n },\n isInForm: 'end'\n }\n }\n }\n});\n\nexport let track = style({\n gridArea: 'track',\n position: 'relative',\n width: 'full',\n height: {\n size: {\n S: 24,\n M: 32,\n L: 40,\n XL: 48\n }\n }\n});\n\nexport let thumbContainer = style({\n size: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n display: 'inline-block',\n position: 'absolute',\n top: '[50%]'\n});\n\n// if precision thumb should have a smaller hit area, then remove this\nexport let thumbHitArea = style({\n size: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n }\n});\n\nexport let thumb = style({\n ...focusRing(),\n display: 'inline-block',\n boxSizing: 'border-box',\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translateY(-50%) translateX(-50%)',\n width: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: size(6)\n }\n },\n height: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n },\n borderRadius: 'full',\n borderStyle: 'solid',\n borderWidth: '[2px]',\n borderColor: {\n default: 'gray-800',\n isHovered: 'gray-900',\n isDragging: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: 'gray-25'\n});\n\nconst trackStyling = {\n height: {\n trackStyle: {\n thin: 4,\n thick: 16\n }\n },\n top: '[50%]',\n borderRadius: {\n trackStyle: {\n thin: 'lg',\n thick: 'sm'\n }\n }\n} as const;\n\nexport let upperTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-300',\n isDisabled: 'disabled'\n },\n translateY: '[-50%]',\n width: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n});\n\nexport let filledTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-700',\n isEmphasized: 'accent-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n translateY: '[-50%]'\n});\n\nexport function SliderBase<T extends number | number[]>(props: SliderBaseProps<T> & {sliderRef: RefObject<HTMLDivElement | null>}) {\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n labelPosition = 'top',\n labelAlign = 'start',\n size = 'M',\n minValue = 0,\n maxValue = 100,\n formatOptions\n } = props;\n let formatter = useNumberFormatter(formatOptions);\n let {direction} = useLocale();\n\n return (\n <AriaSlider\n {...props}\n ref={props.sliderRef}\n className={renderProps => (props.UNSAFE_className || '') + mergeStyles(style(field())({labelPosition, isInForm: !!formContext}), slider({...renderProps, labelPosition, size, isInForm: !!formContext}, props.styles))}>\n {({state}) => {\n let maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatRange\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n\n let outputValue = (\n <SliderOutput\n style={{width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`, fontVariantNumeric: 'tabular-nums'}}\n className={output({direction, labelPosition, isInForm: !!formContext})}>\n {({state}) =>\n state.values.map((_, i) => state.getThumbValueLabel(i)).join(' – ')}\n </SliderOutput>\n );\n\n return (\n <>\n <div className={labelContainer({labelPosition, labelAlign})}>\n <FieldLabel\n isDisabled={props.isDisabled}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {labelPosition === 'top' && outputValue}\n </div>\n <div className={style({...fieldInput(), display: 'inline-flex', alignItems: 'center', gap: {default: 16, size: {L: 20, XL: 24}}})({size})}>\n {props.children}\n {labelPosition === 'side' && outputValue}\n </div>\n </>\n );\n }}\n </AriaSlider>\n );\n}\n\nfunction Slider(props: SliderProps, ref: FocusableRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SliderContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n labelPosition = 'top',\n size = 'M',\n fillOffset,\n isEmphasized,\n trackStyle = 'thin',\n thumbStyle = 'default'\n } = props;\n let thumbRef = useRef(null);\n let inputRef = useRef(null); // TODO: need to pass inputRef to SliderThumb when we release the next version of RAC 1.3.0\n let domRef = useFocusableRef(ref, inputRef);\n let {direction} = useLocale();\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n return (\n <SliderBase\n {...props}\n sliderRef={domRef}>\n <SliderTrack\n className={track({size, labelPosition, isInForm: !!formContext})}>\n {({state, isDisabled}) => {\n\n fillOffset = fillOffset !== undefined ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : state.getThumbMinValue(0);\n\n let fillWidth = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = fillWidth > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n\n return (\n <>\n <div className={upperTrack({isDisabled, trackStyle})} />\n <div style={{width: `${Math.abs(fillWidth) * 100}%`, [cssDirection]: `${offset * 100}%`}} className={filledTrack({isDisabled, isEmphasized, trackStyle})} />\n <SliderThumb className={thumbContainer} index={0} name={props.name} ref={thumbRef} style={(renderProps) => pressScale(thumbRef, {transform: 'translate(-50%, -50%)'})({...renderProps, isPressed: renderProps.isDragging})}>\n {(renderProps) => (\n <div className={thumbHitArea({size})}>\n <div\n className={thumb({\n ...renderProps,\n size,\n thumbStyle\n })} />\n </div>\n )}\n </SliderThumb>\n </>\n );\n }}\n </SliderTrack>\n </SliderBase>\n );\n}\n\nlet _Slider = /*#__PURE__*/ forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAgE;AAEzG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAW,0CAAY;4CAAC;8CAAY;4CAAc;4BAAU;;sCACtJ,gBAAC,CAAA,GAAA,kBAAU;4BAAG,WAAW;4BAAgB,OAAO;4BAAG,MAAM,MAAM,IAAI;4BAAE,KAAK;4BAAU,OAAO,CAAC,cAAgB,CAAA,GAAA,yCAAS,EAAE,UAAU;oCAAC,WAAW;gCAAuB,GAAG;oCAAC,GAAG,WAAW;oCAAE,WAAW,YAAY,UAAU;gCAAA;sCACtN,CAAC,4BACA,gBAAC;oCAAI,WAAW,0CAAa;8CAAC;oCAAI;8CAChC,cAAA,gBAAC;wCACC,WAAW,0CAAM;4CACf,GAAG,WAAW;kDACd;wDACA;wCACF;;;;;;YAMd;;;AAIR;AAEA,IAAI,4CAAU,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Slider.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 {\n Slider as AriaSlider,\n SliderProps as AriaSliderProps,\n ContextValue,\n SliderOutput,\n SliderThumb,\n SliderTrack\n} from 'react-aria-components';\nimport {clamp} from '@react-aria/utils';\nimport {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {focusRing, size, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {mergeStyles} from '../style/runtime';\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocale, useNumberFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SliderBaseProps<T> extends Omit<AriaSliderProps<T>, 'children' | 'style' | 'className' | 'orientation'>, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, StyleProps {\n children?: ReactNode,\n /**\n * The size of the Slider.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Slider should be displayed with an emphasized style.\n */\n isEmphasized?: boolean,\n /**\n * The style of the Slider's track.\n *\n * @default 'thin'\n */\n trackStyle?: 'thin' | 'thick', // TODO: add ramp\n /**\n * The style of the Slider's thumb.\n *\n * @default 'default'\n */\n thumbStyle?: 'default' | 'precise'\n // TODO\n // isEditable?: boolean,\n}\n\nexport interface SliderProps extends Omit<SliderBaseProps<number>, 'children'>, InputDOMProps {\n /**\n * The offset from which to start the fill.\n */\n fillOffset?: number\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, FocusableRefValue<HTMLDivElement>>>(null);\n\nconst slider = style({\n font: 'control',\n alignItems: {\n labelPosition: {\n side: 'center'\n }\n },\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n },\n columnGap: {\n size: {\n S: 16,\n M: 16,\n L: 20,\n XL: 24\n },\n isInForm: 12\n }\n}, getAllowedOverrides());\n\nconst labelContainer = style({\n display: {\n labelPosition: {\n top: 'grid'\n }\n },\n gridArea: 'label',\n width: 'full',\n gridTemplateAreas: {\n labelPosition: {\n top: ['label output']\n }\n },\n gridTemplateColumns: {\n labelPosition: {\n top: [\n '1fr auto'\n ]\n }\n },\n textAlign: {\n labelPosition: {\n side: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n }\n }\n },\n '--field-gap': {\n type: 'paddingBottom',\n value: 0\n }\n});\n\nconst output = style({\n gridArea: 'output',\n textAlign: {\n labelPosition: {\n top: {\n direction: {\n ltr: 'end',\n rtl: 'start'\n }\n },\n side: {\n direction: {\n ltr: 'start',\n rtl: 'end'\n },\n isInForm: 'end'\n }\n }\n }\n});\n\nexport let track = style({\n gridArea: 'track',\n position: 'relative',\n width: 'full',\n height: {\n size: {\n S: 24,\n M: 32,\n L: 40,\n XL: 48\n }\n }\n});\n\nexport let thumbContainer = style({\n size: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n display: 'inline-block',\n position: 'absolute',\n top: '[50%]'\n});\n\n// if precision thumb should have a smaller hit area, then remove this\nexport let thumbHitArea = style({\n size: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n }\n});\n\nexport let thumb = style({\n ...focusRing(),\n display: 'inline-block',\n boxSizing: 'border-box',\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translateY(-50%) translateX(-50%)',\n width: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: size(6)\n }\n },\n height: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n },\n borderRadius: 'full',\n borderStyle: 'solid',\n borderWidth: '[2px]',\n borderColor: {\n default: 'gray-800',\n isHovered: 'gray-900',\n isDragging: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: 'gray-25'\n});\n\nconst trackStyling = {\n height: {\n trackStyle: {\n thin: 4,\n thick: 16\n }\n },\n top: '[50%]',\n borderRadius: {\n trackStyle: {\n thin: 'lg',\n thick: 'sm'\n }\n }\n} as const;\n\nexport let upperTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-300',\n isDisabled: 'disabled'\n },\n translateY: '[-50%]',\n width: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n});\n\nexport let filledTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-700',\n isEmphasized: 'accent-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n translateY: '[-50%]'\n});\n\nexport function SliderBase<T extends number | number[]>(props: SliderBaseProps<T> & {sliderRef: RefObject<HTMLDivElement | null>}) {\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n labelPosition = 'top',\n labelAlign = 'start',\n size = 'M',\n minValue = 0,\n maxValue = 100,\n formatOptions\n } = props;\n let formatter = useNumberFormatter(formatOptions);\n let {direction} = useLocale();\n\n return (\n <AriaSlider\n {...props}\n ref={props.sliderRef}\n className={renderProps => (props.UNSAFE_className || '') + mergeStyles(style(field())({labelPosition, isInForm: !!formContext}), slider({...renderProps, labelPosition, size, isInForm: !!formContext}, props.styles))}>\n {({state}) => {\n let maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatRange\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n\n let outputValue = (\n <SliderOutput\n style={{width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`, fontVariantNumeric: 'tabular-nums'}}\n className={output({direction, labelPosition, isInForm: !!formContext})}>\n {({state}) =>\n state.values.map((_, i) => state.getThumbValueLabel(i)).join(' – ')}\n </SliderOutput>\n );\n\n return (\n <>\n <div className={labelContainer({labelPosition, labelAlign})}>\n <FieldLabel\n isDisabled={props.isDisabled}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {labelPosition === 'top' && outputValue}\n </div>\n <div className={style({...fieldInput(), display: 'inline-flex', alignItems: 'center', gap: {default: 16, size: {L: 20, XL: 24}}})({size})}>\n {props.children}\n {labelPosition === 'side' && outputValue}\n </div>\n </>\n );\n }}\n </AriaSlider>\n );\n}\n\nfunction Slider(props: SliderProps, ref: FocusableRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SliderContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n labelPosition = 'top',\n size = 'M',\n fillOffset,\n isEmphasized,\n trackStyle = 'thin',\n thumbStyle = 'default'\n } = props;\n let thumbRef = useRef(null);\n let inputRef = useRef(null); // TODO: need to pass inputRef to SliderThumb when we release the next version of RAC 1.3.0\n let domRef = useFocusableRef(ref, inputRef);\n let {direction} = useLocale();\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n return (\n <SliderBase\n {...props}\n sliderRef={domRef}>\n <SliderTrack\n className={track({size, labelPosition, isInForm: !!formContext})}>\n {({state, isDisabled}) => {\n\n fillOffset = fillOffset !== undefined ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : state.getThumbMinValue(0);\n\n let fillWidth = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = fillWidth > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n\n return (\n <>\n <div className={upperTrack({isDisabled, trackStyle})} />\n <div style={{width: `${Math.abs(fillWidth) * 100}%`, [cssDirection]: `${offset * 100}%`}} className={filledTrack({isDisabled, isEmphasized, trackStyle})} />\n <SliderThumb className={thumbContainer} index={0} name={props.name} ref={thumbRef} style={(renderProps) => pressScale(thumbRef, {transform: 'translate(-50%, -50%)'})({...renderProps, isPressed: renderProps.isDragging})}>\n {(renderProps) => (\n <div className={thumbHitArea({size})}>\n <div\n className={thumb({\n ...renderProps,\n size,\n thumbStyle\n })} />\n </div>\n )}\n </SliderThumb>\n </>\n );\n }}\n </SliderTrack>\n </SliderBase>\n );\n}\n\nlet _Slider = /*#__PURE__*/ forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.mjs.map"}
|
package/dist/StatusLight.cjs
CHANGED
|
@@ -46,7 +46,7 @@ const $dad358896b5630fa$var$wrapper = function anonymous(props, overrides) {
|
|
|
46
46
|
rules += ' jbH';
|
|
47
47
|
rules += ' jG';
|
|
48
48
|
rules += ' _1d';
|
|
49
|
-
if (!$l) rules += '
|
|
49
|
+
if (!$l) rules += ' lJ';
|
|
50
50
|
rules += ' _c-bc1l9oh';
|
|
51
51
|
rules += ' _c-1uotwbwg';
|
|
52
52
|
rules += ' _c-eo0c6sf';
|
|
@@ -86,32 +86,14 @@ const $dad358896b5630fa$var$wrapper = function anonymous(props, overrides) {
|
|
|
86
86
|
};
|
|
87
87
|
const $dad358896b5630fa$var$light = function anonymous(props) {
|
|
88
88
|
let rules = " .";
|
|
89
|
-
if (props.size === "XL")
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
rules += ' l-8hx8xw';
|
|
98
|
-
} else if (props.size === "S") {
|
|
99
|
-
rules += ' lbg';
|
|
100
|
-
rules += ' lf';
|
|
101
|
-
}
|
|
102
|
-
if (props.size === "XL") {
|
|
103
|
-
rules += ' kb-1n4kawg';
|
|
104
|
-
rules += ' k-9w1ydn';
|
|
105
|
-
} else if (props.size === "L") {
|
|
106
|
-
rules += ' kbi';
|
|
107
|
-
rules += ' kh';
|
|
108
|
-
} else if (props.size === "M") {
|
|
109
|
-
rules += ' kb-1vxtxny';
|
|
110
|
-
rules += ' k-8hx8xw';
|
|
111
|
-
} else if (props.size === "S") {
|
|
112
|
-
rules += ' kbg';
|
|
113
|
-
rules += ' kf';
|
|
114
|
-
}
|
|
89
|
+
if (props.size === "XL") rules += ' l-1l1y6lj';
|
|
90
|
+
else if (props.size === "L") rules += ' le';
|
|
91
|
+
else if (props.size === "M") rules += ' l-tnkbk0';
|
|
92
|
+
else if (props.size === "S") rules += ' ld';
|
|
93
|
+
if (props.size === "XL") rules += ' k-1l1y6lj';
|
|
94
|
+
else if (props.size === "L") rules += ' ke';
|
|
95
|
+
else if (props.size === "M") rules += ' k-tnkbk0';
|
|
96
|
+
else if (props.size === "S") rules += ' kd';
|
|
115
97
|
if (props.isSkeleton) rules += ' eF';
|
|
116
98
|
else if (props.variant === "silver") rules += ' ex';
|
|
117
99
|
else if (props.variant === "brown") rules += ' ew';
|
package/dist/StatusLight.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAyCM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA+D;AAE7G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeN,MAAM
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAyCM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA+D;AAE7G,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCN,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,YAAC,QAAQ,QAAE,OAAO,cAAK,OAAO,QAAE,IAAI,oBAAE,mBAAmB,kBAAI,YAAY,UAAE,MAAM,EAAC,GAAG;IACzF,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,uCAAY;IAE7B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,EACnC,QAAQ,IAAI,CAAC;IAGf,IAAI,CAAC,QAAS,CAAA,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,kBAAkB,AAAD,GAC1D,QAAQ,IAAI,CAAC;IAGf,qBACE,iCAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,OAAO;YAAC,WAAW,CAAC,CAAC;QAAI,EAAE;QAC9C,KAAK;QACL,MAAM;QACN,OAAO;QACP,WAAW,mBAAmB,8BAAQ;kBAAC;qBAAM;QAAO,GAAG;;0BACvD,gCAAC,CAAA,GAAA,wCAAa;0BACZ,cAAA,gCAAC;oBAAI,WAAW,4BAAM;8BAAC;iCAAM;oCAAS;oBAAU;oBAAI,eAAY;8BAC9D,cAAA,gCAAC;wBAAO,GAAE;wBAAM,IAAG;wBAAM,IAAG;;;;0BAGhC,gCAAC,CAAA,GAAA,8BAAG;0BAAG;;;;AAGb;AAEA;;;CAGC,GACD,IAAI,4CAAe,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/StatusLight.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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {CenterBaseline} from './CenterBaseline';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {size, style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: size(10),\n L: 12,\n XL: size(14)\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n }\n});\n\nfunction StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n}\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nlet _StatusLight = /*#__PURE__*/ forwardRef(StatusLight);\nexport {_StatusLight as StatusLight};\n"],"names":[],"version":3,"file":"StatusLight.cjs.map"}
|
package/dist/StatusLight.css
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
align-items: baseline;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.
|
|
18
|
+
.lJ {
|
|
19
19
|
width: fit-content;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -69,36 +69,36 @@
|
|
|
69
69
|
-webkit-tap-highlight-color: #0000;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.
|
|
73
|
-
width: .5rem;
|
|
72
|
+
.ld {
|
|
73
|
+
width: calc(.5rem * var(--s2-scale));
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.l-
|
|
77
|
-
width: .625rem;
|
|
76
|
+
.l-tnkbk0 {
|
|
77
|
+
width: calc(.625rem * var(--s2-scale));
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.
|
|
81
|
-
width: .75rem;
|
|
80
|
+
.le {
|
|
81
|
+
width: calc(.75rem * var(--s2-scale));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
.l-
|
|
85
|
-
width: .875rem;
|
|
84
|
+
.l-1l1y6lj {
|
|
85
|
+
width: calc(.875rem * var(--s2-scale));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.
|
|
89
|
-
height: .5rem;
|
|
88
|
+
.kd {
|
|
89
|
+
height: calc(.5rem * var(--s2-scale));
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.k-
|
|
93
|
-
height: .625rem;
|
|
92
|
+
.k-tnkbk0 {
|
|
93
|
+
height: calc(.625rem * var(--s2-scale));
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
.
|
|
97
|
-
height: .75rem;
|
|
96
|
+
.ke {
|
|
97
|
+
height: calc(.75rem * var(--s2-scale));
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
.k-
|
|
101
|
-
height: .875rem;
|
|
100
|
+
.k-1l1y6lj {
|
|
101
|
+
height: calc(.875rem * var(--s2-scale));
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.ec {
|
|
@@ -259,38 +259,6 @@
|
|
|
259
259
|
._dbj {
|
|
260
260
|
font-size: 1.375rem;
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
.lbg {
|
|
264
|
-
width: .625rem;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.lb-1vxtxny {
|
|
268
|
-
width: .78125rem;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.lbi {
|
|
272
|
-
width: .9375rem;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.lb-1n4kawg {
|
|
276
|
-
width: 1.09375rem;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.kbg {
|
|
280
|
-
height: .625rem;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.kb-1vxtxny {
|
|
284
|
-
height: .78125rem;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.kbi {
|
|
288
|
-
height: .9375rem;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.kb-1n4kawg {
|
|
292
|
-
height: 1.09375rem;
|
|
293
|
-
}
|
|
294
262
|
}
|
|
295
263
|
}
|
|
296
264
|
|
package/dist/StatusLight.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACqDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAfE;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA
|
|
1
|
+
{"mappings":"ACqDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAfE;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAeF","sources":["dcb557d93c6b9336","packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["@import \"f9aed9e8e46292d1\";\n@import \"946093cc8d031f9b\";\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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {CenterBaseline} from './CenterBaseline';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {size, style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\n /**\n * The variant changes the color of the status light.\n * When status lights have a semantic meaning, they should use the variant for semantic colors.\n */\n variant: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n /**\n * The size of the StatusLight.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display as the label.\n */\n children?: ReactNode,\n /**\n * An accessibility role for the status light. Should be set when the status\n * can change at runtime, and no more than one status light will update simultaneously.\n * For cases where multiple statuses can change at the same time, use a Toast instead.\n */\n role?: 'status'\n}\n\nexport const StatusLightContext = createContext<ContextValue<StatusLightProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n display: 'flex',\n gap: 'text-to-visual',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n color: {\n default: 'neutral',\n variant: {\n neutral: 'gray-600'\n }\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n size: {\n size: {\n S: 8,\n M: size(10),\n L: 12,\n XL: size(14)\n }\n },\n fill: {\n variant: {\n informative: 'informative',\n neutral: 'neutral',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n celery: 'celery',\n chartreuse: 'chartreuse',\n cyan: 'cyan',\n fuchsia: 'fuchsia',\n purple: 'purple',\n magenta: 'magenta',\n indigo: 'indigo',\n seafoam: 'seafoam',\n yellow: 'yellow',\n pink: 'pink',\n turquoise: 'turquoise',\n cinnamon: 'cinnamon',\n brown: 'brown',\n silver: 'silver'\n },\n isSkeleton: 'gray-200'\n }\n});\n\nfunction StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n let domRef = useDOMRef(ref);\n let isSkeleton = useIsSkeleton();\n\n if (!children && !props['aria-label']) {\n console.warn('If no children are provided, an aria-label must be specified');\n }\n\n if (!role && (props['aria-label'] || props['aria-labelledby'])) {\n console.warn('A labelled StatusLight must have a role.');\n }\n\n return (\n <div\n {...filterDOMProps(props, {labelable: !!role})}\n ref={domRef}\n role={role}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({size, variant}, styles)}>\n <CenterBaseline>\n <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n </svg>\n </CenterBaseline>\n <Text>{children}</Text>\n </div>\n );\n}\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nlet _StatusLight = /*#__PURE__*/ forwardRef(StatusLight);\nexport {_StatusLight as StatusLight};\n"],"names":[],"version":3,"file":"StatusLight.css.map"}
|