@react-spectrum/s2 3.0.0-nightly-4baa1b08e-241029 → 3.0.0-nightly-dcc0752f8-241031
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 +23 -72
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +64 -152
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +24 -73
- 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 +23 -68
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +32 -96
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +24 -69
- 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 +24 -68
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +50 -130
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +25 -69
- 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/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -17
- package/page.css +7 -0
- package/src/ComboBox.tsx +3 -3
- package/src/Menu.tsx +5 -5
- package/src/Picker.tsx +3 -3
- 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/Field.cjs
CHANGED
|
@@ -152,7 +152,7 @@ function $a0b996a550bb0891$var$FieldLabel(props, ref) {
|
|
|
152
152
|
]
|
|
153
153
|
}),
|
|
154
154
|
contextualHelp && /*#__PURE__*/ (0, $4hgIp$reactjsxruntime.jsx)((0, $e991cbcdf82ced71$exports.CenterBaseline), {
|
|
155
|
-
styles: " . _Ze ka
|
|
155
|
+
styles: " . _Ze ka yc",
|
|
156
156
|
children: /*#__PURE__*/ (0, $4hgIp$reactjsxruntime.jsx)((0, $bab829476f85a155$exports.ContextualHelpContext).Provider, {
|
|
157
157
|
value: {
|
|
158
158
|
id: contextualHelpId,
|
|
@@ -178,37 +178,17 @@ const $a0b996a550bb0891$var$fieldGroupStyles = function anonymous(props) {
|
|
|
178
178
|
rules += ' __b-4cfph1';
|
|
179
179
|
rules += ' __c-4cfph1';
|
|
180
180
|
rules += ' __d-4cfph1';
|
|
181
|
-
if (props.size === "XL")
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
rules += ' qr';
|
|
187
|
-
} else if (props.size === "S") {
|
|
188
|
-
rules += ' qbn';
|
|
189
|
-
rules += ' qm';
|
|
190
|
-
} else if (props.size === "XS") {
|
|
191
|
-
rules += ' qbl';
|
|
192
|
-
rules += ' qk';
|
|
193
|
-
} else {
|
|
194
|
-
rules += ' qbr';
|
|
195
|
-
rules += ' qq';
|
|
196
|
-
}
|
|
181
|
+
if (props.size === "XL") rules += ' qn';
|
|
182
|
+
else if (props.size === "L") rules += ' ql';
|
|
183
|
+
else if (props.size === "S") rules += ' qh';
|
|
184
|
+
else if (props.size === "XS") rules += ' qg';
|
|
185
|
+
else rules += ' qj';
|
|
197
186
|
if (props.isQuiet) rules += ' __ma';
|
|
198
187
|
else rules += ' __m-1s8glxue';
|
|
199
|
-
if (props.size === "XL")
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
rules += ' -usygro_l-bU';
|
|
204
|
-
rules += ' -usygro_l-T';
|
|
205
|
-
} else if (props.size === "S") {
|
|
206
|
-
rules += ' -usygro_l-bQ';
|
|
207
|
-
rules += ' -usygro_l-P';
|
|
208
|
-
} else {
|
|
209
|
-
rules += ' -usygro_l-bS';
|
|
210
|
-
rules += ' -usygro_l-R';
|
|
211
|
-
}
|
|
188
|
+
if (props.size === "XL") rules += ' -usygro_l-A';
|
|
189
|
+
else if (props.size === "L") rules += ' -usygro_l-z';
|
|
190
|
+
else if (props.size === "S") rules += ' -usygro_l-x';
|
|
191
|
+
else rules += ' -usygro_l-y';
|
|
212
192
|
rules += ' m-rwozxi';
|
|
213
193
|
rules += ' _Zd';
|
|
214
194
|
rules += ' _1c';
|
|
@@ -287,22 +267,11 @@ const $a0b996a550bb0891$var$fieldGroupStyles = function anonymous(props) {
|
|
|
287
267
|
rules += ' -_375tnn_D-I';
|
|
288
268
|
rules += ' -_375toy_s-c';
|
|
289
269
|
rules += ' -_375toz_t-c';
|
|
290
|
-
if (props.size === "XL")
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
rules += ' -_375toq_k-r';
|
|
296
|
-
} else if (props.size === "S") {
|
|
297
|
-
rules += ' -_375toq_k-bn';
|
|
298
|
-
rules += ' -_375toq_k-m';
|
|
299
|
-
} else if (props.size === "XS") {
|
|
300
|
-
rules += ' -_375toq_k-bl';
|
|
301
|
-
rules += ' -_375toq_k-k';
|
|
302
|
-
} else {
|
|
303
|
-
rules += ' -_375toq_k-br';
|
|
304
|
-
rules += ' -_375toq_k-q';
|
|
305
|
-
}
|
|
270
|
+
if (props.size === "XL") rules += ' -_375toq_k-n';
|
|
271
|
+
else if (props.size === "L") rules += ' -_375toq_k-l';
|
|
272
|
+
else if (props.size === "S") rules += ' -_375toq_k-h';
|
|
273
|
+
else if (props.size === "XS") rules += ' -_375toq_k-g';
|
|
274
|
+
else rules += ' -_375toq_k-j';
|
|
306
275
|
return rules;
|
|
307
276
|
};
|
|
308
277
|
function $a0b996a550bb0891$var$FieldGroup(props, ref) {
|
|
@@ -336,7 +305,7 @@ function $a0b996a550bb0891$var$Input(props, ref) {
|
|
|
336
305
|
...otherProps,
|
|
337
306
|
ref: ref,
|
|
338
307
|
style: UNSAFE_style,
|
|
339
|
-
className: UNSAFE_className + (0, $308b180f49d82d28$exports.mergeStyles)(" . Ea Fa Ca Da ba a-17zqamw _c-17zqamw _d-17zqamw _e-17zqamw _9-3t1y _8-3t1y qa
|
|
308
|
+
className: UNSAFE_className + (0, $308b180f49d82d28$exports.mergeStyles)(" . Ea Fa Ca Da ba a-17zqamw _c-17zqamw _d-17zqamw _e-17zqamw _9-3t1y _8-3t1y qa lG _La wf __vb __wb _ma _pb", styles)
|
|
340
309
|
});
|
|
341
310
|
}
|
|
342
311
|
let $a0b996a550bb0891$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $4hgIp$react.forwardRef)($a0b996a550bb0891$var$Input);
|
package/dist/Field.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AAkCD,SAAS,iCAAW,KAAsB,EAAE,GAA6B;IACvE,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,cACF,UAAU,cACV,UAAU,QACV,OAAO,yBACP,qBAAqB,sDACrB,+CAA+C,mBAC/C,UAAU,iBACV,aAAa,eACb,WAAW,kBACX,cAAc,WACd,OAAO,gBACP,YAAY,oBACZ,mBAAmB,IACnB,GAAG,YACJ,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,mBAAmB,CAAA,GAAA,2BAAI;IAC3B,IAAI,uBAAuB,CAAA,GAAA,2BAAI;IAC/B,IAAI,kBAAkB,CAAC,WAAW,EAAE,EAClC,WAAW,EAAE,GAAG;IAGlB,IAAI,CAAC,MAAM,QAAQ,EACjB,OAAO;IAGT,qBACE,iCAAC;QACC,WAAW;;;;;;;;;;;;;UAoBR;wBAAC;2BAAY;qBAAe;QAAO;;0BACtC,iCAAC,CAAA,GAAA,gCAAI;gBACF,GAAG,UAAU;gBACd,KAAK;gBACL,OAAO;gBACP,WAAW,mBAAmB,CAAA,GAAA,qCAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAoB;mCAAC;gCAAe;0BAAY;iCAAM;gBAAW,IAAI,MAAM,MAAM;;oBAC1H,MAAM,QAAQ;oBACb,CAAA,cAAc,uBAAuB,OAAM,mBAC3C,iCAAC;wBAAK,SAAS;;4BAAiC;4BAE7C,u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BAAK,YAAY,MAAM,UAAU;YAAA;kBAC9G,CAAA,GAAA,6CAAiB,EAAE,MAAM,QAAQ,EAAE,CAAC,UAAU,oBAAC,gBAAgB,EAAC,iBAAM;;oBACpE,MAAM,aAAa,kBAClB,gCAAC,CAAA,GAAA,wCAAa;kCACZ,cAAA,gCAAC,CAAA,GAAA,iCAAQ;;kCAGb,gCAAC;kCAAM,YAAY,iBAAiB,IAAI,CAAC;;;;;AAIjD;AAEO,SAAS,0CAAe,KAA6B;IAC1D,qBACE,gCAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,QAAQ,CAAA,GAAA,wCAAa,EAAE;wBACrB,MAAM;wBACN,MAAM;oBAUJ;oBACJ,MAAM;gBAMR;aAAE;SACH;kBACA,CAAC,MAAM,UAAU,kBAAI,gCAAC,CAAA,GAAA,iCAAQ;;AAGrC","sources":["packages/@react-spectrum/s2/src/Field.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 AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Alignment, DOMRef, NecessityIndicator} from '@react-types/shared';\nimport AsteriskIcon from '../ui-icons/Asterisk';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline, centerBaseline, centerBaselineBefore} from './CenterBaseline';\nimport {composeRenderProps, FieldError, FieldErrorProps, Group, GroupProps, Label, LabelProps, Provider, Input as RACInput, InputProps as RACInputProps, Text} from 'react-aria-components';\nimport {ContextualHelpContext} from './ContextualHelp';\nimport {fieldInput, fieldLabel, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {StyleString} from '../style/types';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface FieldLabelProps extends Omit<LabelProps, 'className' | 'style' | 'children'>, StyleProps {\n isDisabled?: boolean,\n isRequired?: boolean,\n size?: 'S' | 'M' | 'L' | 'XL',\n necessityIndicator?: NecessityIndicator,\n labelAlign?: Alignment,\n labelPosition?: 'top' | 'side',\n includeNecessityIndicatorInAccessibilityName?: boolean,\n staticColor?: 'white' | 'black',\n contextualHelp?: ReactNode,\n isQuiet?: boolean,\n children?: ReactNode\n}\n\nfunction FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isDisabled,\n isRequired,\n size = 'M',\n necessityIndicator = 'icon',\n includeNecessityIndicatorInAccessibilityName = false,\n labelAlign,\n labelPosition,\n staticColor,\n contextualHelp,\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = '',\n ...labelProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let contextualHelpId = useId();\n let fallbackLabelPropsId = useId();\n if (contextualHelp && !labelProps.id) {\n labelProps.id = fallbackLabelPropsId;\n }\n\n if (!props.children) {\n return null;\n }\n\n return (\n <div\n className={style({\n gridArea: 'label',\n display: 'inline',\n textAlign: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n },\n paddingBottom: {\n labelPosition: {\n top: '--field-gap'\n }\n },\n contain: {\n labelPosition: {\n top: 'inline-size'\n },\n isQuiet: 'none'\n }\n })({labelAlign, labelPosition, isQuiet})}>\n <Label\n {...labelProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style(fieldLabel())({labelPosition, isDisabled, size, staticColor}), props.styles)}>\n {props.children}\n {(isRequired || necessityIndicator === 'label') && (\n <span className={style({whiteSpace: 'nowrap'})}>\n \n {necessityIndicator === 'icon' &&\n <AsteriskIcon\n size={size === 'S' ? 'M' : size}\n className={style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })}\n aria-label={includeNecessityIndicatorInAccessibilityName ? stringFormatter.format('label.(required)') : undefined} />\n }\n {necessityIndicator === 'label' &&\n /* The necessity label is hidden to screen readers if the field is required because\n * aria-required is set on the field in that case. That will already be announced,\n * so no need to duplicate it here. If optional, we do want it to be announced here.\n */\n <span aria-hidden={!includeNecessityIndicatorInAccessibilityName ? isRequired : undefined}>\n {isRequired ? stringFormatter.format('label.(required)') : stringFormatter.format('label.(optional)')}\n </span>\n }\n </span>\n )}\n </Label>\n {contextualHelp && (\n <CenterBaseline\n styles={style({\n display: 'inline-flex',\n height: 0,\n marginStart: 4\n })}>\n <ContextualHelpContext.Provider\n value={{\n id: contextualHelpId,\n 'aria-labelledby': labelProps?.id ? `${labelProps.id} ${contextualHelpId}` : undefined,\n size: (size === 'L' || size === 'XL') ? 'S' : 'XS'\n }}>\n {contextualHelp}\n </ContextualHelpContext.Provider>\n </CenterBaseline>\n )}\n </div>\n );\n}\n\nlet _FieldLabel = forwardRef(FieldLabel);\nexport {_FieldLabel as FieldLabel};\n\ninterface FieldGroupProps extends Omit<GroupProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n size?: 'S' | 'M' | 'L' | 'XL',\n children?: ReactNode,\n styles?: StyleString\n}\n\nconst fieldGroupStyles = style({\n ...focusRing(),\n ...fieldInput(),\n display: 'flex',\n alignItems: 'center',\n height: 'control',\n boxSizing: 'border-box',\n paddingX: 'edge-to-text',\n font: 'control',\n borderRadius: 'control',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n borderColor: {\n default: baseColor('gray-300'),\n isInvalid: 'negative',\n isFocusWithin: {\n default: 'gray-900',\n isInvalid: 'negative-1000',\n forcedColors: 'Highlight'\n },\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n backgroundColor: 'gray-25',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nfunction FieldGroup(props: FieldGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <Group\n ref={ref}\n {...props}\n onPointerDown={(e) => {\n // Forward focus to input element when clicking on a non-interactive child (e.g. icon or padding)\n if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n onPointerUp={e => {\n if (e.pointerType !== 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + ' ' + centerBaselineBefore + mergeStyles(\n fieldGroupStyles({...renderProps, size: props.size || 'M'}),\n props.styles\n )} />\n );\n}\n\nlet _FieldGroup = forwardRef(FieldGroup);\nexport {_FieldGroup as FieldGroup};\n\nexport interface InputProps extends Omit<RACInputProps, 'className' | 'style'>, StyleProps {}\n\nfunction Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n let {UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n return (\n <RACInput\n {...otherProps}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style({\n padding: 0,\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n width: 'full',\n outlineStyle: 'none',\n borderStyle: 'none',\n truncate: true\n }), styles)} />\n );\n}\n\nlet _Input = forwardRef(Input);\nexport {_Input as Input};\n\ninterface HelpTextProps extends FieldErrorProps {\n size?: 'S' | 'M' | 'L' | 'XL',\n isDisabled?: boolean,\n isInvalid?: boolean, // TODO: export FieldErrorContext from RAC to get this.\n description?: ReactNode,\n showErrorIcon?: boolean\n}\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative',\n isDisabled: 'disabled'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nexport function HelpText(props: HelpTextProps & {descriptionRef?: DOMRef<HTMLDivElement>, errorRef?: DOMRef<HTMLDivElement>}) {\n let domDescriptionRef = useDOMRef(props.descriptionRef || null);\n let domErrorRef = useDOMRef(props.errorRef || null);\n\n if (!props.isInvalid && props.description) {\n return (\n <Text\n slot=\"description\"\n ref={domDescriptionRef}\n className={helpTextStyles({size: props.size || 'M', isDisabled: props.isDisabled})}>\n {props.description}\n </Text>\n );\n }\n\n return (\n <FieldError\n {...props}\n ref={domErrorRef}\n className={renderProps => helpTextStyles({...renderProps, size: props.size || 'M', isDisabled: props.isDisabled})}>\n {composeRenderProps(props.children, (children, {validationErrors}) => (<>\n {props.showErrorIcon &&\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n }\n <span>{children || validationErrors.join(' ')}</span>\n </>))}\n </FieldError>\n );\n}\n\nexport function FieldErrorIcon(props: {isDisabled?: boolean}) {\n return (\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n order: 0,\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'negative',\n forcedColors: 'ButtonText'\n }\n }\n })}),\n styles: style({\n size: fontRelative(20),\n marginStart: 'text-to-visual',\n marginEnd: fontRelative(-2),\n flexShrink: 0\n })\n }]\n ]}>\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gCAAC,CAAA,GAAA,wCAAa;kCACZ,cAAA,gCAAC,CAAA,GAAA,iCAAQ;;kCAGb,gCAAC;kCAAM,YAAY,iBAAiB,IAAI,CAAC;;;;;AAIjD;AAEO,SAAS,0CAAe,KAA6B;IAC1D,qBACE,gCAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,QAAQ,CAAA,GAAA,wCAAa,EAAE;wBACrB,MAAM;wBACN,MAAM;oBAUJ;oBACJ,MAAM;gBAMR;aAAE;SACH;kBACA,CAAC,MAAM,UAAU,kBAAI,gCAAC,CAAA,GAAA,iCAAQ;;AAGrC","sources":["packages/@react-spectrum/s2/src/Field.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 AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Alignment, DOMRef, NecessityIndicator} from '@react-types/shared';\nimport AsteriskIcon from '../ui-icons/Asterisk';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline, centerBaseline, centerBaselineBefore} from './CenterBaseline';\nimport {composeRenderProps, FieldError, FieldErrorProps, Group, GroupProps, Label, LabelProps, Provider, Input as RACInput, InputProps as RACInputProps, Text} from 'react-aria-components';\nimport {ContextualHelpContext} from './ContextualHelp';\nimport {fieldInput, fieldLabel, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {StyleString} from '../style/types';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface FieldLabelProps extends Omit<LabelProps, 'className' | 'style' | 'children'>, StyleProps {\n isDisabled?: boolean,\n isRequired?: boolean,\n size?: 'S' | 'M' | 'L' | 'XL',\n necessityIndicator?: NecessityIndicator,\n labelAlign?: Alignment,\n labelPosition?: 'top' | 'side',\n includeNecessityIndicatorInAccessibilityName?: boolean,\n staticColor?: 'white' | 'black',\n contextualHelp?: ReactNode,\n isQuiet?: boolean,\n children?: ReactNode\n}\n\nfunction FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isDisabled,\n isRequired,\n size = 'M',\n necessityIndicator = 'icon',\n includeNecessityIndicatorInAccessibilityName = false,\n labelAlign,\n labelPosition,\n staticColor,\n contextualHelp,\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = '',\n ...labelProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let contextualHelpId = useId();\n let fallbackLabelPropsId = useId();\n if (contextualHelp && !labelProps.id) {\n labelProps.id = fallbackLabelPropsId;\n }\n\n if (!props.children) {\n return null;\n }\n\n return (\n <div\n className={style({\n gridArea: 'label',\n display: 'inline',\n textAlign: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n },\n paddingBottom: {\n labelPosition: {\n top: '--field-gap'\n }\n },\n contain: {\n labelPosition: {\n top: 'inline-size'\n },\n isQuiet: 'none'\n }\n })({labelAlign, labelPosition, isQuiet})}>\n <Label\n {...labelProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style(fieldLabel())({labelPosition, isDisabled, size, staticColor}), props.styles)}>\n {props.children}\n {(isRequired || necessityIndicator === 'label') && (\n <span className={style({whiteSpace: 'nowrap'})}>\n \n {necessityIndicator === 'icon' &&\n <AsteriskIcon\n size={size === 'S' ? 'M' : size}\n className={style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })}\n aria-label={includeNecessityIndicatorInAccessibilityName ? stringFormatter.format('label.(required)') : undefined} />\n }\n {necessityIndicator === 'label' &&\n /* The necessity label is hidden to screen readers if the field is required because\n * aria-required is set on the field in that case. That will already be announced,\n * so no need to duplicate it here. If optional, we do want it to be announced here.\n */\n <span aria-hidden={!includeNecessityIndicatorInAccessibilityName ? isRequired : undefined}>\n {isRequired ? stringFormatter.format('label.(required)') : stringFormatter.format('label.(optional)')}\n </span>\n }\n </span>\n )}\n </Label>\n {contextualHelp && (\n <CenterBaseline\n styles={style({\n display: 'inline-flex',\n height: 0,\n marginStart: 4\n })}>\n <ContextualHelpContext.Provider\n value={{\n id: contextualHelpId,\n 'aria-labelledby': labelProps?.id ? `${labelProps.id} ${contextualHelpId}` : undefined,\n size: (size === 'L' || size === 'XL') ? 'S' : 'XS'\n }}>\n {contextualHelp}\n </ContextualHelpContext.Provider>\n </CenterBaseline>\n )}\n </div>\n );\n}\n\nlet _FieldLabel = forwardRef(FieldLabel);\nexport {_FieldLabel as FieldLabel};\n\ninterface FieldGroupProps extends Omit<GroupProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n size?: 'S' | 'M' | 'L' | 'XL',\n children?: ReactNode,\n styles?: StyleString\n}\n\nconst fieldGroupStyles = style({\n ...focusRing(),\n ...fieldInput(),\n display: 'flex',\n alignItems: 'center',\n height: 'control',\n boxSizing: 'border-box',\n paddingX: 'edge-to-text',\n font: 'control',\n borderRadius: 'control',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n borderColor: {\n default: baseColor('gray-300'),\n isInvalid: 'negative',\n isFocusWithin: {\n default: 'gray-900',\n isInvalid: 'negative-1000',\n forcedColors: 'Highlight'\n },\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n backgroundColor: 'gray-25',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nfunction FieldGroup(props: FieldGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <Group\n ref={ref}\n {...props}\n onPointerDown={(e) => {\n // Forward focus to input element when clicking on a non-interactive child (e.g. icon or padding)\n if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n onPointerUp={e => {\n if (e.pointerType !== 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + ' ' + centerBaselineBefore + mergeStyles(\n fieldGroupStyles({...renderProps, size: props.size || 'M'}),\n props.styles\n )} />\n );\n}\n\nlet _FieldGroup = forwardRef(FieldGroup);\nexport {_FieldGroup as FieldGroup};\n\nexport interface InputProps extends Omit<RACInputProps, 'className' | 'style'>, StyleProps {}\n\nfunction Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n let {UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n return (\n <RACInput\n {...otherProps}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style({\n padding: 0,\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n width: 'full',\n outlineStyle: 'none',\n borderStyle: 'none',\n truncate: true\n }), styles)} />\n );\n}\n\nlet _Input = forwardRef(Input);\nexport {_Input as Input};\n\ninterface HelpTextProps extends FieldErrorProps {\n size?: 'S' | 'M' | 'L' | 'XL',\n isDisabled?: boolean,\n isInvalid?: boolean, // TODO: export FieldErrorContext from RAC to get this.\n description?: ReactNode,\n showErrorIcon?: boolean\n}\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative',\n isDisabled: 'disabled'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nexport function HelpText(props: HelpTextProps & {descriptionRef?: DOMRef<HTMLDivElement>, errorRef?: DOMRef<HTMLDivElement>}) {\n let domDescriptionRef = useDOMRef(props.descriptionRef || null);\n let domErrorRef = useDOMRef(props.errorRef || null);\n\n if (!props.isInvalid && props.description) {\n return (\n <Text\n slot=\"description\"\n ref={domDescriptionRef}\n className={helpTextStyles({size: props.size || 'M', isDisabled: props.isDisabled})}>\n {props.description}\n </Text>\n );\n }\n\n return (\n <FieldError\n {...props}\n ref={domErrorRef}\n className={renderProps => helpTextStyles({...renderProps, size: props.size || 'M', isDisabled: props.isDisabled})}>\n {composeRenderProps(props.children, (children, {validationErrors}) => (<>\n {props.showErrorIcon &&\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n }\n <span>{children || validationErrors.join(' ')}</span>\n </>))}\n </FieldError>\n );\n}\n\nexport function FieldErrorIcon(props: {isDisabled?: boolean}) {\n return (\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n order: 0,\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'negative',\n forcedColors: 'ButtonText'\n }\n }\n })}),\n styles: style({\n size: fontRelative(20),\n marginStart: 'text-to-visual',\n marginEnd: fontRelative(-2),\n flexShrink: 0\n })\n }]\n ]}>\n {!props.isDisabled && <AlertIcon />}\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"Field.cjs.map"}
|
package/dist/Field.css
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.ka {
|
|
47
|
-
height:
|
|
47
|
+
height: calc(0rem * var(--s2-scale));
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.yc {
|
|
@@ -83,44 +83,44 @@
|
|
|
83
83
|
grid-row-end: input;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.
|
|
87
|
-
min-width: 2rem;
|
|
86
|
+
.qj {
|
|
87
|
+
min-width: calc(2rem * var(--s2-scale));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
.
|
|
91
|
-
min-width: 1.25rem;
|
|
90
|
+
.qg {
|
|
91
|
+
min-width: calc(1.25rem * var(--s2-scale));
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
.
|
|
95
|
-
min-width: 1.5rem;
|
|
94
|
+
.qh {
|
|
95
|
+
min-width: calc(1.5rem * var(--s2-scale));
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
.
|
|
99
|
-
min-width: 2.5rem;
|
|
98
|
+
.ql {
|
|
99
|
+
min-width: calc(2.5rem * var(--s2-scale));
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
.
|
|
103
|
-
min-width: 3rem;
|
|
102
|
+
.qn {
|
|
103
|
+
min-width: calc(3rem * var(--s2-scale));
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
.__ma {
|
|
107
107
|
contain: none;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
.-usygro_l-
|
|
111
|
-
--defaultWidth: 13rem;
|
|
110
|
+
.-usygro_l-y {
|
|
111
|
+
--defaultWidth: calc(13rem * var(--s2-scale));
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.-usygro_l-
|
|
115
|
-
--defaultWidth: 12rem;
|
|
114
|
+
.-usygro_l-x {
|
|
115
|
+
--defaultWidth: calc(12rem * var(--s2-scale));
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
.-usygro_l-
|
|
119
|
-
--defaultWidth: 14rem;
|
|
118
|
+
.-usygro_l-z {
|
|
119
|
+
--defaultWidth: calc(14rem * var(--s2-scale));
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
.-usygro_l-
|
|
123
|
-
--defaultWidth: 15rem;
|
|
122
|
+
.-usygro_l-A {
|
|
123
|
+
--defaultWidth: calc(15rem * var(--s2-scale));
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.m-rwozxi {
|
|
@@ -243,24 +243,24 @@
|
|
|
243
243
|
--t: 2px;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
.-_375toq_k-
|
|
247
|
-
--k: 2rem;
|
|
246
|
+
.-_375toq_k-j {
|
|
247
|
+
--k: calc(2rem * var(--s2-scale));
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
.-_375toq_k-
|
|
251
|
-
--k: 1.25rem;
|
|
250
|
+
.-_375toq_k-g {
|
|
251
|
+
--k: calc(1.25rem * var(--s2-scale));
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
.-_375toq_k-
|
|
255
|
-
--k: 1.5rem;
|
|
254
|
+
.-_375toq_k-h {
|
|
255
|
+
--k: calc(1.5rem * var(--s2-scale));
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
.-_375toq_k-
|
|
259
|
-
--k: 2.5rem;
|
|
258
|
+
.-_375toq_k-l {
|
|
259
|
+
--k: calc(2.5rem * var(--s2-scale));
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
.-_375toq_k-
|
|
263
|
-
--k: 3rem;
|
|
262
|
+
.-_375toq_k-n {
|
|
263
|
+
--k: calc(3rem * var(--s2-scale));
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
.Ea {
|
|
@@ -310,10 +310,10 @@
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
.qa {
|
|
313
|
-
min-width:
|
|
313
|
+
min-width: calc(0rem * var(--s2-scale));
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
.
|
|
316
|
+
.lG {
|
|
317
317
|
width: 100%;
|
|
318
318
|
}
|
|
319
319
|
|
|
@@ -526,70 +526,6 @@
|
|
|
526
526
|
|
|
527
527
|
@layer _.b.b {
|
|
528
528
|
@media not ((hover: hover) and (pointer: fine)) {
|
|
529
|
-
.kba {
|
|
530
|
-
height: 0;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
.qbr {
|
|
534
|
-
min-width: 2.5rem;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.qbl {
|
|
538
|
-
min-width: 1.5625rem;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
.qbn {
|
|
542
|
-
min-width: 1.875rem;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
.qbu {
|
|
546
|
-
min-width: 3.125rem;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.qby {
|
|
550
|
-
min-width: 3.75rem;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
.-usygro_l-bS {
|
|
554
|
-
--defaultWidth: 16.25rem;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
.-usygro_l-bQ {
|
|
558
|
-
--defaultWidth: 15rem;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
.-usygro_l-bU {
|
|
562
|
-
--defaultWidth: 17.5rem;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
.-usygro_l-bV {
|
|
566
|
-
--defaultWidth: 18.75rem;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
.-_375toq_k-br {
|
|
570
|
-
--k: 2.5rem;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
.-_375toq_k-bl {
|
|
574
|
-
--k: 1.5625rem;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
.-_375toq_k-bn {
|
|
578
|
-
--k: 1.875rem;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.-_375toq_k-bu {
|
|
582
|
-
--k: 3.125rem;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.-_375toq_k-by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AA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8DH;;;;EAAA;;;;EAWF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AApQD;EA2LM;;;;EAAA;;;;;AA3LN;;AAyBiC;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IA8BhC;;;;IA4BO;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA2EuB;;;;IA6BzB;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAyEL;;;;;;AA3OgC;EAAA;IAAA;;;;IA0DzB;;;;IAAA;;;;IAAA;;;;IAsKL;;;;;;AAtKK;EAAA;IAAA;;;;;;AA2EuB","sources":["18dc2c1262434547","packages/@react-spectrum/s2/src/Field.tsx"],"sourcesContent":["@import \"5451fbb197e5f742\";\n@import \"4c96520903762dec\";\n@import \"dec1ed3fcae5e2a0\";\n@import \"7f2f9d36b130a0fc\";\n@import \"d78be91638043334\";\n@import \"1287e36439fa04a9\";\n@import \"ae2e3271ad92acb6\";\n@import \"657c7598b6083861\";\n@import \"227d65898b7fdc0f\";\n@import \"312761f7202cddfd\";\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 AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Alignment, DOMRef, NecessityIndicator} from '@react-types/shared';\nimport AsteriskIcon from '../ui-icons/Asterisk';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline, centerBaseline, centerBaselineBefore} from './CenterBaseline';\nimport {composeRenderProps, FieldError, FieldErrorProps, Group, GroupProps, Label, LabelProps, Provider, Input as RACInput, InputProps as RACInputProps, Text} from 'react-aria-components';\nimport {ContextualHelpContext} from './ContextualHelp';\nimport {fieldInput, fieldLabel, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {StyleString} from '../style/types';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface FieldLabelProps extends Omit<LabelProps, 'className' | 'style' | 'children'>, StyleProps {\n isDisabled?: boolean,\n isRequired?: boolean,\n size?: 'S' | 'M' | 'L' | 'XL',\n necessityIndicator?: NecessityIndicator,\n labelAlign?: Alignment,\n labelPosition?: 'top' | 'side',\n includeNecessityIndicatorInAccessibilityName?: boolean,\n staticColor?: 'white' | 'black',\n contextualHelp?: ReactNode,\n isQuiet?: boolean,\n children?: ReactNode\n}\n\nfunction FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isDisabled,\n isRequired,\n size = 'M',\n necessityIndicator = 'icon',\n includeNecessityIndicatorInAccessibilityName = false,\n labelAlign,\n labelPosition,\n staticColor,\n contextualHelp,\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = '',\n ...labelProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let contextualHelpId = useId();\n let fallbackLabelPropsId = useId();\n if (contextualHelp && !labelProps.id) {\n labelProps.id = fallbackLabelPropsId;\n }\n\n if (!props.children) {\n return null;\n }\n\n return (\n <div\n className={style({\n gridArea: 'label',\n display: 'inline',\n textAlign: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n },\n paddingBottom: {\n labelPosition: {\n top: '--field-gap'\n }\n },\n contain: {\n labelPosition: {\n top: 'inline-size'\n },\n isQuiet: 'none'\n }\n })({labelAlign, labelPosition, isQuiet})}>\n <Label\n {...labelProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style(fieldLabel())({labelPosition, isDisabled, size, staticColor}), props.styles)}>\n {props.children}\n {(isRequired || necessityIndicator === 'label') && (\n <span className={style({whiteSpace: 'nowrap'})}>\n \n {necessityIndicator === 'icon' &&\n <AsteriskIcon\n size={size === 'S' ? 'M' : size}\n className={style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })}\n aria-label={includeNecessityIndicatorInAccessibilityName ? stringFormatter.format('label.(required)') : undefined} />\n }\n {necessityIndicator === 'label' &&\n /* The necessity label is hidden to screen readers if the field is required because\n * aria-required is set on the field in that case. That will already be announced,\n * so no need to duplicate it here. If optional, we do want it to be announced here.\n */\n <span aria-hidden={!includeNecessityIndicatorInAccessibilityName ? isRequired : undefined}>\n {isRequired ? stringFormatter.format('label.(required)') : stringFormatter.format('label.(optional)')}\n </span>\n }\n </span>\n )}\n </Label>\n {contextualHelp && (\n <CenterBaseline\n styles={style({\n display: 'inline-flex',\n height: 0,\n marginStart: 4\n })}>\n <ContextualHelpContext.Provider\n value={{\n id: contextualHelpId,\n 'aria-labelledby': labelProps?.id ? `${labelProps.id} ${contextualHelpId}` : undefined,\n size: (size === 'L' || size === 'XL') ? 'S' : 'XS'\n }}>\n {contextualHelp}\n </ContextualHelpContext.Provider>\n </CenterBaseline>\n )}\n </div>\n );\n}\n\nlet _FieldLabel = forwardRef(FieldLabel);\nexport {_FieldLabel as FieldLabel};\n\ninterface FieldGroupProps extends Omit<GroupProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n size?: 'S' | 'M' | 'L' | 'XL',\n children?: ReactNode,\n styles?: StyleString\n}\n\nconst fieldGroupStyles = style({\n ...focusRing(),\n ...fieldInput(),\n display: 'flex',\n alignItems: 'center',\n height: 'control',\n boxSizing: 'border-box',\n paddingX: 'edge-to-text',\n font: 'control',\n borderRadius: 'control',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n borderColor: {\n default: baseColor('gray-300'),\n isInvalid: 'negative',\n isFocusWithin: {\n default: 'gray-900',\n isInvalid: 'negative-1000',\n forcedColors: 'Highlight'\n },\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n backgroundColor: 'gray-25',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nfunction FieldGroup(props: FieldGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <Group\n ref={ref}\n {...props}\n onPointerDown={(e) => {\n // Forward focus to input element when clicking on a non-interactive child (e.g. icon or padding)\n if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n onPointerUp={e => {\n if (e.pointerType !== 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + ' ' + centerBaselineBefore + mergeStyles(\n fieldGroupStyles({...renderProps, size: props.size || 'M'}),\n props.styles\n )} />\n );\n}\n\nlet _FieldGroup = forwardRef(FieldGroup);\nexport {_FieldGroup as FieldGroup};\n\nexport interface InputProps extends Omit<RACInputProps, 'className' | 'style'>, StyleProps {}\n\nfunction Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n let {UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n return (\n <RACInput\n {...otherProps}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style({\n padding: 0,\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n width: 'full',\n outlineStyle: 'none',\n borderStyle: 'none',\n truncate: true\n }), styles)} />\n );\n}\n\nlet _Input = forwardRef(Input);\nexport {_Input as Input};\n\ninterface HelpTextProps extends FieldErrorProps {\n size?: 'S' | 'M' | 'L' | 'XL',\n isDisabled?: boolean,\n isInvalid?: boolean, // TODO: export FieldErrorContext from RAC to get this.\n description?: ReactNode,\n showErrorIcon?: boolean\n}\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative',\n isDisabled: 'disabled'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nexport function HelpText(props: HelpTextProps & {descriptionRef?: DOMRef<HTMLDivElement>, errorRef?: DOMRef<HTMLDivElement>}) {\n let domDescriptionRef = useDOMRef(props.descriptionRef || null);\n let domErrorRef = useDOMRef(props.errorRef || null);\n\n if (!props.isInvalid && props.description) {\n return (\n <Text\n slot=\"description\"\n ref={domDescriptionRef}\n className={helpTextStyles({size: props.size || 'M', isDisabled: props.isDisabled})}>\n {props.description}\n </Text>\n );\n }\n\n return (\n <FieldError\n {...props}\n ref={domErrorRef}\n className={renderProps => helpTextStyles({...renderProps, size: props.size || 'M', isDisabled: props.isDisabled})}>\n {composeRenderProps(props.children, (children, {validationErrors}) => (<>\n {props.showErrorIcon &&\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n }\n <span>{children || validationErrors.join(' ')}</span>\n </>))}\n </FieldError>\n );\n}\n\nexport function FieldErrorIcon(props: {isDisabled?: boolean}) {\n return (\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n order: 0,\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'negative',\n forcedColors: 'ButtonText'\n }\n }\n })}),\n styles: style({\n size: fontRelative(20),\n marginStart: 'text-to-visual',\n marginEnd: fontRelative(-2),\n flexShrink: 0\n })\n }]\n ]}>\n {!props.isDisabled && <AlertIcon />}\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"Field.css.map"}
|
|
1
|
+
{"mappings":"AC2EiB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyBiC;;;;EAAA;;;;EA8BhC;;;;EAAA;;;;EAAA;;;;EA4BO;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2EuB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6BzB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8DH;;;;EAAA;;;;EAWF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AApQD;EA2LM;;;;EAAA;;;;;AA3LN;;AAyBiC;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAkK3B;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAyEL;;;;;;AA3OgC;EAAA;IAAA;;;;IA0DzB;;;;IAAA;;;;IAAA;;;;IAsKL;;;;;;AAtKK;EAAA;IAAA;;;;;;AA2EuB","sources":["18dc2c1262434547","packages/@react-spectrum/s2/src/Field.tsx"],"sourcesContent":["@import \"5451fbb197e5f742\";\n@import \"4c96520903762dec\";\n@import \"dec1ed3fcae5e2a0\";\n@import \"7f2f9d36b130a0fc\";\n@import \"d78be91638043334\";\n@import \"1287e36439fa04a9\";\n@import \"ae2e3271ad92acb6\";\n@import \"657c7598b6083861\";\n@import \"227d65898b7fdc0f\";\n@import \"312761f7202cddfd\";\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 AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Alignment, DOMRef, NecessityIndicator} from '@react-types/shared';\nimport AsteriskIcon from '../ui-icons/Asterisk';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline, centerBaseline, centerBaselineBefore} from './CenterBaseline';\nimport {composeRenderProps, FieldError, FieldErrorProps, Group, GroupProps, Label, LabelProps, Provider, Input as RACInput, InputProps as RACInputProps, Text} from 'react-aria-components';\nimport {ContextualHelpContext} from './ContextualHelp';\nimport {fieldInput, fieldLabel, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {StyleString} from '../style/types';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface FieldLabelProps extends Omit<LabelProps, 'className' | 'style' | 'children'>, StyleProps {\n isDisabled?: boolean,\n isRequired?: boolean,\n size?: 'S' | 'M' | 'L' | 'XL',\n necessityIndicator?: NecessityIndicator,\n labelAlign?: Alignment,\n labelPosition?: 'top' | 'side',\n includeNecessityIndicatorInAccessibilityName?: boolean,\n staticColor?: 'white' | 'black',\n contextualHelp?: ReactNode,\n isQuiet?: boolean,\n children?: ReactNode\n}\n\nfunction FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isDisabled,\n isRequired,\n size = 'M',\n necessityIndicator = 'icon',\n includeNecessityIndicatorInAccessibilityName = false,\n labelAlign,\n labelPosition,\n staticColor,\n contextualHelp,\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = '',\n ...labelProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let contextualHelpId = useId();\n let fallbackLabelPropsId = useId();\n if (contextualHelp && !labelProps.id) {\n labelProps.id = fallbackLabelPropsId;\n }\n\n if (!props.children) {\n return null;\n }\n\n return (\n <div\n className={style({\n gridArea: 'label',\n display: 'inline',\n textAlign: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n },\n paddingBottom: {\n labelPosition: {\n top: '--field-gap'\n }\n },\n contain: {\n labelPosition: {\n top: 'inline-size'\n },\n isQuiet: 'none'\n }\n })({labelAlign, labelPosition, isQuiet})}>\n <Label\n {...labelProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style(fieldLabel())({labelPosition, isDisabled, size, staticColor}), props.styles)}>\n {props.children}\n {(isRequired || necessityIndicator === 'label') && (\n <span className={style({whiteSpace: 'nowrap'})}>\n \n {necessityIndicator === 'icon' &&\n <AsteriskIcon\n size={size === 'S' ? 'M' : size}\n className={style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })}\n aria-label={includeNecessityIndicatorInAccessibilityName ? stringFormatter.format('label.(required)') : undefined} />\n }\n {necessityIndicator === 'label' &&\n /* The necessity label is hidden to screen readers if the field is required because\n * aria-required is set on the field in that case. That will already be announced,\n * so no need to duplicate it here. If optional, we do want it to be announced here.\n */\n <span aria-hidden={!includeNecessityIndicatorInAccessibilityName ? isRequired : undefined}>\n {isRequired ? stringFormatter.format('label.(required)') : stringFormatter.format('label.(optional)')}\n </span>\n }\n </span>\n )}\n </Label>\n {contextualHelp && (\n <CenterBaseline\n styles={style({\n display: 'inline-flex',\n height: 0,\n marginStart: 4\n })}>\n <ContextualHelpContext.Provider\n value={{\n id: contextualHelpId,\n 'aria-labelledby': labelProps?.id ? `${labelProps.id} ${contextualHelpId}` : undefined,\n size: (size === 'L' || size === 'XL') ? 'S' : 'XS'\n }}>\n {contextualHelp}\n </ContextualHelpContext.Provider>\n </CenterBaseline>\n )}\n </div>\n );\n}\n\nlet _FieldLabel = forwardRef(FieldLabel);\nexport {_FieldLabel as FieldLabel};\n\ninterface FieldGroupProps extends Omit<GroupProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n size?: 'S' | 'M' | 'L' | 'XL',\n children?: ReactNode,\n styles?: StyleString\n}\n\nconst fieldGroupStyles = style({\n ...focusRing(),\n ...fieldInput(),\n display: 'flex',\n alignItems: 'center',\n height: 'control',\n boxSizing: 'border-box',\n paddingX: 'edge-to-text',\n font: 'control',\n borderRadius: 'control',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n borderColor: {\n default: baseColor('gray-300'),\n isInvalid: 'negative',\n isFocusWithin: {\n default: 'gray-900',\n isInvalid: 'negative-1000',\n forcedColors: 'Highlight'\n },\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n backgroundColor: 'gray-25',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nfunction FieldGroup(props: FieldGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <Group\n ref={ref}\n {...props}\n onPointerDown={(e) => {\n // Forward focus to input element when clicking on a non-interactive child (e.g. icon or padding)\n if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n onPointerUp={e => {\n if (e.pointerType !== 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + ' ' + centerBaselineBefore + mergeStyles(\n fieldGroupStyles({...renderProps, size: props.size || 'M'}),\n props.styles\n )} />\n );\n}\n\nlet _FieldGroup = forwardRef(FieldGroup);\nexport {_FieldGroup as FieldGroup};\n\nexport interface InputProps extends Omit<RACInputProps, 'className' | 'style'>, StyleProps {}\n\nfunction Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n let {UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n return (\n <RACInput\n {...otherProps}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style({\n padding: 0,\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n width: 'full',\n outlineStyle: 'none',\n borderStyle: 'none',\n truncate: true\n }), styles)} />\n );\n}\n\nlet _Input = forwardRef(Input);\nexport {_Input as Input};\n\ninterface HelpTextProps extends FieldErrorProps {\n size?: 'S' | 'M' | 'L' | 'XL',\n isDisabled?: boolean,\n isInvalid?: boolean, // TODO: export FieldErrorContext from RAC to get this.\n description?: ReactNode,\n showErrorIcon?: boolean\n}\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative',\n isDisabled: 'disabled'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nexport function HelpText(props: HelpTextProps & {descriptionRef?: DOMRef<HTMLDivElement>, errorRef?: DOMRef<HTMLDivElement>}) {\n let domDescriptionRef = useDOMRef(props.descriptionRef || null);\n let domErrorRef = useDOMRef(props.errorRef || null);\n\n if (!props.isInvalid && props.description) {\n return (\n <Text\n slot=\"description\"\n ref={domDescriptionRef}\n className={helpTextStyles({size: props.size || 'M', isDisabled: props.isDisabled})}>\n {props.description}\n </Text>\n );\n }\n\n return (\n <FieldError\n {...props}\n ref={domErrorRef}\n className={renderProps => helpTextStyles({...renderProps, size: props.size || 'M', isDisabled: props.isDisabled})}>\n {composeRenderProps(props.children, (children, {validationErrors}) => (<>\n {props.showErrorIcon &&\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n }\n <span>{children || validationErrors.join(' ')}</span>\n </>))}\n </FieldError>\n );\n}\n\nexport function FieldErrorIcon(props: {isDisabled?: boolean}) {\n return (\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n order: 0,\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'negative',\n forcedColors: 'ButtonText'\n }\n }\n })}),\n styles: style({\n size: fontRelative(20),\n marginStart: 'text-to-visual',\n marginEnd: fontRelative(-2),\n flexShrink: 0\n })\n }]\n ]}>\n {!props.isDisabled && <AlertIcon />}\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"Field.css.map"}
|
package/dist/Field.mjs
CHANGED
|
@@ -142,7 +142,7 @@ function $9afd80978c252040$var$FieldLabel(props, ref) {
|
|
|
142
142
|
]
|
|
143
143
|
}),
|
|
144
144
|
contextualHelp && /*#__PURE__*/ (0, $7A6HT$jsx)((0, $1f4b04be3f24aae3$export$768dac55bb57081d), {
|
|
145
|
-
styles: " . _Ze ka
|
|
145
|
+
styles: " . _Ze ka yc",
|
|
146
146
|
children: /*#__PURE__*/ (0, $7A6HT$jsx)((0, $8e176595bc49ca3f$export$41b9afaaba473494).Provider, {
|
|
147
147
|
value: {
|
|
148
148
|
id: contextualHelpId,
|
|
@@ -168,37 +168,17 @@ const $9afd80978c252040$var$fieldGroupStyles = function anonymous(props) {
|
|
|
168
168
|
rules += ' __b-4cfph1';
|
|
169
169
|
rules += ' __c-4cfph1';
|
|
170
170
|
rules += ' __d-4cfph1';
|
|
171
|
-
if (props.size === "XL")
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
rules += ' qr';
|
|
177
|
-
} else if (props.size === "S") {
|
|
178
|
-
rules += ' qbn';
|
|
179
|
-
rules += ' qm';
|
|
180
|
-
} else if (props.size === "XS") {
|
|
181
|
-
rules += ' qbl';
|
|
182
|
-
rules += ' qk';
|
|
183
|
-
} else {
|
|
184
|
-
rules += ' qbr';
|
|
185
|
-
rules += ' qq';
|
|
186
|
-
}
|
|
171
|
+
if (props.size === "XL") rules += ' qn';
|
|
172
|
+
else if (props.size === "L") rules += ' ql';
|
|
173
|
+
else if (props.size === "S") rules += ' qh';
|
|
174
|
+
else if (props.size === "XS") rules += ' qg';
|
|
175
|
+
else rules += ' qj';
|
|
187
176
|
if (props.isQuiet) rules += ' __ma';
|
|
188
177
|
else rules += ' __m-1s8glxue';
|
|
189
|
-
if (props.size === "XL")
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
rules += ' -usygro_l-bU';
|
|
194
|
-
rules += ' -usygro_l-T';
|
|
195
|
-
} else if (props.size === "S") {
|
|
196
|
-
rules += ' -usygro_l-bQ';
|
|
197
|
-
rules += ' -usygro_l-P';
|
|
198
|
-
} else {
|
|
199
|
-
rules += ' -usygro_l-bS';
|
|
200
|
-
rules += ' -usygro_l-R';
|
|
201
|
-
}
|
|
178
|
+
if (props.size === "XL") rules += ' -usygro_l-A';
|
|
179
|
+
else if (props.size === "L") rules += ' -usygro_l-z';
|
|
180
|
+
else if (props.size === "S") rules += ' -usygro_l-x';
|
|
181
|
+
else rules += ' -usygro_l-y';
|
|
202
182
|
rules += ' m-rwozxi';
|
|
203
183
|
rules += ' _Zd';
|
|
204
184
|
rules += ' _1c';
|
|
@@ -277,22 +257,11 @@ const $9afd80978c252040$var$fieldGroupStyles = function anonymous(props) {
|
|
|
277
257
|
rules += ' -_375tnn_D-I';
|
|
278
258
|
rules += ' -_375toy_s-c';
|
|
279
259
|
rules += ' -_375toz_t-c';
|
|
280
|
-
if (props.size === "XL")
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
rules += ' -_375toq_k-r';
|
|
286
|
-
} else if (props.size === "S") {
|
|
287
|
-
rules += ' -_375toq_k-bn';
|
|
288
|
-
rules += ' -_375toq_k-m';
|
|
289
|
-
} else if (props.size === "XS") {
|
|
290
|
-
rules += ' -_375toq_k-bl';
|
|
291
|
-
rules += ' -_375toq_k-k';
|
|
292
|
-
} else {
|
|
293
|
-
rules += ' -_375toq_k-br';
|
|
294
|
-
rules += ' -_375toq_k-q';
|
|
295
|
-
}
|
|
260
|
+
if (props.size === "XL") rules += ' -_375toq_k-n';
|
|
261
|
+
else if (props.size === "L") rules += ' -_375toq_k-l';
|
|
262
|
+
else if (props.size === "S") rules += ' -_375toq_k-h';
|
|
263
|
+
else if (props.size === "XS") rules += ' -_375toq_k-g';
|
|
264
|
+
else rules += ' -_375toq_k-j';
|
|
296
265
|
return rules;
|
|
297
266
|
};
|
|
298
267
|
function $9afd80978c252040$var$FieldGroup(props, ref) {
|
|
@@ -326,7 +295,7 @@ function $9afd80978c252040$var$Input(props, ref) {
|
|
|
326
295
|
...otherProps,
|
|
327
296
|
ref: ref,
|
|
328
297
|
style: UNSAFE_style,
|
|
329
|
-
className: UNSAFE_className + (0, $feb886035e0d4633$export$e618dc39ac9ad607)(" . Ea Fa Ca Da ba a-17zqamw _c-17zqamw _d-17zqamw _e-17zqamw _9-3t1y _8-3t1y qa
|
|
298
|
+
className: UNSAFE_className + (0, $feb886035e0d4633$export$e618dc39ac9ad607)(" . Ea Fa Ca Da ba a-17zqamw _c-17zqamw _d-17zqamw _e-17zqamw _9-3t1y _8-3t1y qa lG _La wf __vb __wb _ma _pb", styles)
|
|
330
299
|
});
|
|
331
300
|
}
|
|
332
301
|
let $9afd80978c252040$export$f5b8910cec6cf069 = /*#__PURE__*/ (0, $7A6HT$forwardRef)($9afd80978c252040$var$Input);
|
package/dist/Field.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AAkCD,SAAS,iCAAW,KAAsB,EAAE,GAA6B;IACvE,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAChE,IAAI,cACF,UAAU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yCAAa,EAAE;wBACrB,MAAM;wBACN,MAAM;oBAUJ;oBACJ,MAAM;gBAMR;aAAE;SACH;kBACA,CAAC,MAAM,UAAU,kBAAI,gBAAC,CAAA,GAAA,wCAAQ;;AAGrC","sources":["packages/@react-spectrum/s2/src/Field.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 AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Alignment, DOMRef, NecessityIndicator} from '@react-types/shared';\nimport AsteriskIcon from '../ui-icons/Asterisk';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline, centerBaseline, centerBaselineBefore} from './CenterBaseline';\nimport {composeRenderProps, FieldError, FieldErrorProps, Group, GroupProps, Label, LabelProps, Provider, Input as RACInput, InputProps as RACInputProps, Text} from 'react-aria-components';\nimport {ContextualHelpContext} from './ContextualHelp';\nimport {fieldInput, fieldLabel, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {StyleString} from '../style/types';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface FieldLabelProps extends Omit<LabelProps, 'className' | 'style' | 'children'>, StyleProps {\n isDisabled?: boolean,\n isRequired?: boolean,\n size?: 'S' | 'M' | 'L' | 'XL',\n necessityIndicator?: NecessityIndicator,\n labelAlign?: Alignment,\n labelPosition?: 'top' | 'side',\n includeNecessityIndicatorInAccessibilityName?: boolean,\n staticColor?: 'white' | 'black',\n contextualHelp?: ReactNode,\n isQuiet?: boolean,\n children?: ReactNode\n}\n\nfunction FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isDisabled,\n isRequired,\n size = 'M',\n necessityIndicator = 'icon',\n includeNecessityIndicatorInAccessibilityName = false,\n labelAlign,\n labelPosition,\n staticColor,\n contextualHelp,\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = '',\n ...labelProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let contextualHelpId = useId();\n let fallbackLabelPropsId = useId();\n if (contextualHelp && !labelProps.id) {\n labelProps.id = fallbackLabelPropsId;\n }\n\n if (!props.children) {\n return null;\n }\n\n return (\n <div\n className={style({\n gridArea: 'label',\n display: 'inline',\n textAlign: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n },\n paddingBottom: {\n labelPosition: {\n top: '--field-gap'\n }\n },\n contain: {\n labelPosition: {\n top: 'inline-size'\n },\n isQuiet: 'none'\n }\n })({labelAlign, labelPosition, isQuiet})}>\n <Label\n {...labelProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style(fieldLabel())({labelPosition, isDisabled, size, staticColor}), props.styles)}>\n {props.children}\n {(isRequired || necessityIndicator === 'label') && (\n <span className={style({whiteSpace: 'nowrap'})}>\n \n {necessityIndicator === 'icon' &&\n <AsteriskIcon\n size={size === 'S' ? 'M' : size}\n className={style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })}\n aria-label={includeNecessityIndicatorInAccessibilityName ? stringFormatter.format('label.(required)') : undefined} />\n }\n {necessityIndicator === 'label' &&\n /* The necessity label is hidden to screen readers if the field is required because\n * aria-required is set on the field in that case. That will already be announced,\n * so no need to duplicate it here. If optional, we do want it to be announced here.\n */\n <span aria-hidden={!includeNecessityIndicatorInAccessibilityName ? isRequired : undefined}>\n {isRequired ? stringFormatter.format('label.(required)') : stringFormatter.format('label.(optional)')}\n </span>\n }\n </span>\n )}\n </Label>\n {contextualHelp && (\n <CenterBaseline\n styles={style({\n display: 'inline-flex',\n height: 0,\n marginStart: 4\n })}>\n <ContextualHelpContext.Provider\n value={{\n id: contextualHelpId,\n 'aria-labelledby': labelProps?.id ? `${labelProps.id} ${contextualHelpId}` : undefined,\n size: (size === 'L' || size === 'XL') ? 'S' : 'XS'\n }}>\n {contextualHelp}\n </ContextualHelpContext.Provider>\n </CenterBaseline>\n )}\n </div>\n );\n}\n\nlet _FieldLabel = forwardRef(FieldLabel);\nexport {_FieldLabel as FieldLabel};\n\ninterface FieldGroupProps extends Omit<GroupProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n size?: 'S' | 'M' | 'L' | 'XL',\n children?: ReactNode,\n styles?: StyleString\n}\n\nconst fieldGroupStyles = style({\n ...focusRing(),\n ...fieldInput(),\n display: 'flex',\n alignItems: 'center',\n height: 'control',\n boxSizing: 'border-box',\n paddingX: 'edge-to-text',\n font: 'control',\n borderRadius: 'control',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n borderColor: {\n default: baseColor('gray-300'),\n isInvalid: 'negative',\n isFocusWithin: {\n default: 'gray-900',\n isInvalid: 'negative-1000',\n forcedColors: 'Highlight'\n },\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n backgroundColor: 'gray-25',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nfunction FieldGroup(props: FieldGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <Group\n ref={ref}\n {...props}\n onPointerDown={(e) => {\n // Forward focus to input element when clicking on a non-interactive child (e.g. icon or padding)\n if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n onPointerUp={e => {\n if (e.pointerType !== 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + ' ' + centerBaselineBefore + mergeStyles(\n fieldGroupStyles({...renderProps, size: props.size || 'M'}),\n props.styles\n )} />\n );\n}\n\nlet _FieldGroup = forwardRef(FieldGroup);\nexport {_FieldGroup as FieldGroup};\n\nexport interface InputProps extends Omit<RACInputProps, 'className' | 'style'>, StyleProps {}\n\nfunction Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n let {UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n return (\n <RACInput\n {...otherProps}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style({\n padding: 0,\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n width: 'full',\n outlineStyle: 'none',\n borderStyle: 'none',\n truncate: true\n }), styles)} />\n );\n}\n\nlet _Input = forwardRef(Input);\nexport {_Input as Input};\n\ninterface HelpTextProps extends FieldErrorProps {\n size?: 'S' | 'M' | 'L' | 'XL',\n isDisabled?: boolean,\n isInvalid?: boolean, // TODO: export FieldErrorContext from RAC to get this.\n description?: ReactNode,\n showErrorIcon?: boolean\n}\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative',\n isDisabled: 'disabled'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nexport function HelpText(props: HelpTextProps & {descriptionRef?: DOMRef<HTMLDivElement>, errorRef?: DOMRef<HTMLDivElement>}) {\n let domDescriptionRef = useDOMRef(props.descriptionRef || null);\n let domErrorRef = useDOMRef(props.errorRef || null);\n\n if (!props.isInvalid && props.description) {\n return (\n <Text\n slot=\"description\"\n ref={domDescriptionRef}\n className={helpTextStyles({size: props.size || 'M', isDisabled: props.isDisabled})}>\n {props.description}\n </Text>\n );\n }\n\n return (\n <FieldError\n {...props}\n ref={domErrorRef}\n className={renderProps => helpTextStyles({...renderProps, size: props.size || 'M', isDisabled: props.isDisabled})}>\n {composeRenderProps(props.children, (children, {validationErrors}) => (<>\n {props.showErrorIcon &&\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n }\n <span>{children || validationErrors.join(' ')}</span>\n </>))}\n </FieldError>\n );\n}\n\nexport function FieldErrorIcon(props: {isDisabled?: boolean}) {\n return (\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n order: 0,\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'negative',\n forcedColors: 'ButtonText'\n }\n }\n })}),\n styles: style({\n size: fontRelative(20),\n marginStart: 'text-to-visual',\n marginEnd: fontRelative(-2),\n flexShrink: 0\n })\n }]\n ]}>\n {!props.isDisabled && <AlertIcon />}\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"Field.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AAkCD,SAAS,iCAAW,KAAsB,EAAE,GAA6B;IACvE,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAChE,IAAI,cACF,UAAU,cACV,UAAU,QACV,OAAO,yBACP,qBAAqB,sDACrB,+CAA+C,mBAC/C,UAAU,iBACV,aAAa,eACb,WAAW,kBACX,cAAc,WACd,OAAO,gBACP,YAAY,oBACZ,mBA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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 AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Alignment, DOMRef, NecessityIndicator} from '@react-types/shared';\nimport AsteriskIcon from '../ui-icons/Asterisk';\nimport {baseColor, focusRing, fontRelative, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline, centerBaseline, centerBaselineBefore} from './CenterBaseline';\nimport {composeRenderProps, FieldError, FieldErrorProps, Group, GroupProps, Label, LabelProps, Provider, Input as RACInput, InputProps as RACInputProps, Text} from 'react-aria-components';\nimport {ContextualHelpContext} from './ContextualHelp';\nimport {fieldInput, fieldLabel, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeStyles} from '../style/runtime';\nimport {StyleString} from '../style/types';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface FieldLabelProps extends Omit<LabelProps, 'className' | 'style' | 'children'>, StyleProps {\n isDisabled?: boolean,\n isRequired?: boolean,\n size?: 'S' | 'M' | 'L' | 'XL',\n necessityIndicator?: NecessityIndicator,\n labelAlign?: Alignment,\n labelPosition?: 'top' | 'side',\n includeNecessityIndicatorInAccessibilityName?: boolean,\n staticColor?: 'white' | 'black',\n contextualHelp?: ReactNode,\n isQuiet?: boolean,\n children?: ReactNode\n}\n\nfunction FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n isDisabled,\n isRequired,\n size = 'M',\n necessityIndicator = 'icon',\n includeNecessityIndicatorInAccessibilityName = false,\n labelAlign,\n labelPosition,\n staticColor,\n contextualHelp,\n isQuiet,\n UNSAFE_style,\n UNSAFE_className = '',\n ...labelProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let contextualHelpId = useId();\n let fallbackLabelPropsId = useId();\n if (contextualHelp && !labelProps.id) {\n labelProps.id = fallbackLabelPropsId;\n }\n\n if (!props.children) {\n return null;\n }\n\n return (\n <div\n className={style({\n gridArea: 'label',\n display: 'inline',\n textAlign: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n },\n paddingBottom: {\n labelPosition: {\n top: '--field-gap'\n }\n },\n contain: {\n labelPosition: {\n top: 'inline-size'\n },\n isQuiet: 'none'\n }\n })({labelAlign, labelPosition, isQuiet})}>\n <Label\n {...labelProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style(fieldLabel())({labelPosition, isDisabled, size, staticColor}), props.styles)}>\n {props.children}\n {(isRequired || necessityIndicator === 'label') && (\n <span className={style({whiteSpace: 'nowrap'})}>\n \n {necessityIndicator === 'icon' &&\n <AsteriskIcon\n size={size === 'S' ? 'M' : size}\n className={style({\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n })}\n aria-label={includeNecessityIndicatorInAccessibilityName ? stringFormatter.format('label.(required)') : undefined} />\n }\n {necessityIndicator === 'label' &&\n /* The necessity label is hidden to screen readers if the field is required because\n * aria-required is set on the field in that case. That will already be announced,\n * so no need to duplicate it here. If optional, we do want it to be announced here.\n */\n <span aria-hidden={!includeNecessityIndicatorInAccessibilityName ? isRequired : undefined}>\n {isRequired ? stringFormatter.format('label.(required)') : stringFormatter.format('label.(optional)')}\n </span>\n }\n </span>\n )}\n </Label>\n {contextualHelp && (\n <CenterBaseline\n styles={style({\n display: 'inline-flex',\n height: 0,\n marginStart: 4\n })}>\n <ContextualHelpContext.Provider\n value={{\n id: contextualHelpId,\n 'aria-labelledby': labelProps?.id ? `${labelProps.id} ${contextualHelpId}` : undefined,\n size: (size === 'L' || size === 'XL') ? 'S' : 'XS'\n }}>\n {contextualHelp}\n </ContextualHelpContext.Provider>\n </CenterBaseline>\n )}\n </div>\n );\n}\n\nlet _FieldLabel = forwardRef(FieldLabel);\nexport {_FieldLabel as FieldLabel};\n\ninterface FieldGroupProps extends Omit<GroupProps, 'className' | 'style' | 'children'>, UnsafeStyles {\n size?: 'S' | 'M' | 'L' | 'XL',\n children?: ReactNode,\n styles?: StyleString\n}\n\nconst fieldGroupStyles = style({\n ...focusRing(),\n ...fieldInput(),\n display: 'flex',\n alignItems: 'center',\n height: 'control',\n boxSizing: 'border-box',\n paddingX: 'edge-to-text',\n font: 'control',\n borderRadius: 'control',\n borderWidth: 2,\n borderStyle: 'solid',\n transition: 'default',\n borderColor: {\n default: baseColor('gray-300'),\n isInvalid: 'negative',\n isFocusWithin: {\n default: 'gray-900',\n isInvalid: 'negative-1000',\n forcedColors: 'Highlight'\n },\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n backgroundColor: 'gray-25',\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nfunction FieldGroup(props: FieldGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <Group\n ref={ref}\n {...props}\n onPointerDown={(e) => {\n // Forward focus to input element when clicking on a non-interactive child (e.g. icon or padding)\n if (e.pointerType === 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n onPointerUp={e => {\n if (e.pointerType !== 'mouse' && !(e.target as Element).closest('button,input,textarea')) {\n e.preventDefault();\n e.currentTarget.querySelector('input')?.focus();\n }\n }}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + ' ' + centerBaselineBefore + mergeStyles(\n fieldGroupStyles({...renderProps, size: props.size || 'M'}),\n props.styles\n )} />\n );\n}\n\nlet _FieldGroup = forwardRef(FieldGroup);\nexport {_FieldGroup as FieldGroup};\n\nexport interface InputProps extends Omit<RACInputProps, 'className' | 'style'>, StyleProps {}\n\nfunction Input(props: InputProps, ref: ForwardedRef<HTMLInputElement>) {\n let {UNSAFE_className = '', UNSAFE_style, styles, ...otherProps} = props;\n return (\n <RACInput\n {...otherProps}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + mergeStyles(style({\n padding: 0,\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n width: 'full',\n outlineStyle: 'none',\n borderStyle: 'none',\n truncate: true\n }), styles)} />\n );\n}\n\nlet _Input = forwardRef(Input);\nexport {_Input as Input};\n\ninterface HelpTextProps extends FieldErrorProps {\n size?: 'S' | 'M' | 'L' | 'XL',\n isDisabled?: boolean,\n isInvalid?: boolean, // TODO: export FieldErrorContext from RAC to get this.\n description?: ReactNode,\n showErrorIcon?: boolean\n}\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative',\n isDisabled: 'disabled'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: {\n default: 'text',\n isDisabled: 'default'\n }\n});\n\nexport function HelpText(props: HelpTextProps & {descriptionRef?: DOMRef<HTMLDivElement>, errorRef?: DOMRef<HTMLDivElement>}) {\n let domDescriptionRef = useDOMRef(props.descriptionRef || null);\n let domErrorRef = useDOMRef(props.errorRef || null);\n\n if (!props.isInvalid && props.description) {\n return (\n <Text\n slot=\"description\"\n ref={domDescriptionRef}\n className={helpTextStyles({size: props.size || 'M', isDisabled: props.isDisabled})}>\n {props.description}\n </Text>\n );\n }\n\n return (\n <FieldError\n {...props}\n ref={domErrorRef}\n className={renderProps => helpTextStyles({...renderProps, size: props.size || 'M', isDisabled: props.isDisabled})}>\n {composeRenderProps(props.children, (children, {validationErrors}) => (<>\n {props.showErrorIcon &&\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n }\n <span>{children || validationErrors.join(' ')}</span>\n </>))}\n </FieldError>\n );\n}\n\nexport function FieldErrorIcon(props: {isDisabled?: boolean}) {\n return (\n <Provider\n values={[\n [IconContext, {\n render: centerBaseline({\n slot: 'icon',\n styles: style({\n order: 0,\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'negative',\n forcedColors: 'ButtonText'\n }\n }\n })}),\n styles: style({\n size: fontRelative(20),\n marginStart: 'text-to-visual',\n marginEnd: fontRelative(-2),\n flexShrink: 0\n })\n }]\n ]}>\n {!props.isDisabled && <AlertIcon />}\n </Provider>\n );\n}\n"],"names":[],"version":3,"file":"Field.mjs.map"}
|
|
@@ -89,26 +89,12 @@ const $55f1b8940d3e02db$var$illustration = function anonymous(props) {
|
|
|
89
89
|
rules += ' __b-1e6vo9b';
|
|
90
90
|
rules += ' __c-1e6vo9b';
|
|
91
91
|
rules += ' __d-1e6vo9b';
|
|
92
|
-
if (props.size === "L")
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
} else if (props.size === "S") {
|
|
99
|
-
rules += ' lbF';
|
|
100
|
-
rules += ' lE';
|
|
101
|
-
}
|
|
102
|
-
if (props.size === "L") {
|
|
103
|
-
rules += ' kbM';
|
|
104
|
-
rules += ' kJ';
|
|
105
|
-
} else if (props.size === "M") {
|
|
106
|
-
rules += ' kbF';
|
|
107
|
-
rules += ' kE';
|
|
108
|
-
} else if (props.size === "S") {
|
|
109
|
-
rules += ' kbF';
|
|
110
|
-
rules += ' kE';
|
|
111
|
-
}
|
|
92
|
+
if (props.size === "L") rules += ' lv';
|
|
93
|
+
else if (props.size === "M") rules += ' lr';
|
|
94
|
+
else if (props.size === "S") rules += ' lr';
|
|
95
|
+
if (props.size === "L") rules += ' kv';
|
|
96
|
+
else if (props.size === "M") rules += ' kr';
|
|
97
|
+
else if (props.size === "S") rules += ' kr';
|
|
112
98
|
rules += ' _4d';
|
|
113
99
|
if (props.isDropTarget) {
|
|
114
100
|
if (props.isPressed) rules += ' -rwx0fg_a-z';
|