@react-spectrum/form 3.6.7 → 3.7.1

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/import.mjs CHANGED
@@ -1,12 +1,17 @@
1
+ "use client";
2
+
1
3
  import "./main.css";
2
4
  import {useStyleProps as $011V3$useStyleProps, useDOMRef as $011V3$useDOMRef, classNames as $011V3$classNames} from "@react-spectrum/utils";
3
5
  import {filterDOMProps as $011V3$filterDOMProps} from "@react-aria/utils";
6
+ import {FormValidationContext as $011V3$FormValidationContext} from "@react-stately/form";
4
7
  import {useProviderProps as $011V3$useProviderProps, Provider as $011V3$Provider} from "@react-spectrum/provider";
5
8
  import $011V3$react, {useContext as $011V3$useContext} from "react";
6
9
 
10
+
7
11
  function $parcel$interopDefault(a) {
8
12
  return a && a.__esModule ? a.default : a;
9
13
  }
14
+
10
15
  function $parcel$export(e, n, v, s) {
11
16
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
17
  }
@@ -35,6 +40,7 @@ function $parcel$export(e, n, v, s) {
35
40
 
36
41
 
37
42
 
43
+
38
44
  var $cd231e464c886c86$exports = {};
39
45
 
40
46
  $parcel$export($cd231e464c886c86$exports, "contextualHelp", () => $cd231e464c886c86$export$4ba534aba1836d, (v) => $cd231e464c886c86$export$4ba534aba1836d = v);
@@ -141,17 +147,20 @@ const $ac118ceca79b8650$var$formPropNames = new Set([
141
147
  "encType",
142
148
  "method",
143
149
  "target",
144
- "onSubmit"
150
+ "onSubmit",
151
+ "onReset",
152
+ "onInvalid"
145
153
  ]);
146
154
  function $ac118ceca79b8650$var$Form(props, ref) {
147
155
  props = (0, $011V3$useProviderProps)(props);
148
- let { children: children, labelPosition: labelPosition = "top", labelAlign: labelAlign = "start", isRequired: isRequired, necessityIndicator: necessityIndicator, isQuiet: isQuiet, isEmphasized: isEmphasized, isDisabled: isDisabled, isReadOnly: isReadOnly, validationState: validationState, ...otherProps } = props;
156
+ let { children: children, labelPosition: labelPosition = "top", labelAlign: labelAlign = "start", isRequired: isRequired, necessityIndicator: necessityIndicator, isQuiet: isQuiet, isEmphasized: isEmphasized, isDisabled: isDisabled, isReadOnly: isReadOnly, validationState: validationState, validationBehavior: validationBehavior, validationErrors: validationErrors, ...otherProps } = props;
149
157
  let { styleProps: styleProps } = (0, $011V3$useStyleProps)(otherProps);
150
158
  let domRef = (0, $011V3$useDOMRef)(ref);
151
159
  let ctx = {
152
160
  labelPosition: labelPosition,
153
161
  labelAlign: labelAlign,
154
- necessityIndicator: necessityIndicator
162
+ necessityIndicator: necessityIndicator,
163
+ validationBehavior: validationBehavior
155
164
  };
156
165
  return /*#__PURE__*/ (0, $011V3$react).createElement("form", {
157
166
  ...(0, $011V3$filterDOMProps)(otherProps, {
@@ -159,7 +168,7 @@ function $ac118ceca79b8650$var$Form(props, ref) {
159
168
  propNames: $ac118ceca79b8650$var$formPropNames
160
169
  }),
161
170
  ...styleProps,
162
- noValidate: true,
171
+ noValidate: validationBehavior !== "native",
163
172
  ref: domRef,
164
173
  className: (0, $011V3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports))), "spectrum-Form", {
165
174
  "spectrum-Form--positionSide": labelPosition === "side",
@@ -174,7 +183,9 @@ function $ac118ceca79b8650$var$Form(props, ref) {
174
183
  isReadOnly: isReadOnly,
175
184
  isRequired: isRequired,
176
185
  validationState: validationState
177
- }, children)));
186
+ }, /*#__PURE__*/ (0, $011V3$react).createElement((0, $011V3$FormValidationContext).Provider, {
187
+ value: validationErrors || {}
188
+ }, children))));
178
189
  }
179
190
  /**
180
191
  * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
package/dist/main.css CHANGED
@@ -1 +1,276 @@
1
- .A-HlBa_i18nFontFamily{font-synthesis:weight;font-family:adobe-clean,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Ubuntu,Trebuchet MS,Lucida Grande,sans-serif}.A-HlBa_i18nFontFamily:lang(ar){font-family:myriad-arabic,adobe-clean,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Ubuntu,Trebuchet MS,Lucida Grande,sans-serif}.A-HlBa_i18nFontFamily:lang(he){font-family:myriad-hebrew,adobe-clean,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Ubuntu,Trebuchet MS,Lucida Grande,sans-serif}.A-HlBa_i18nFontFamily:lang(zh){font-family:adobe-clean-han-traditional,source-han-traditional,MingLiu,Heiti TC Light,sans-serif}.A-HlBa_i18nFontFamily:lang(zh-Hans){font-family:adobe-clean-han-simplified-c,source-han-simplified-c,SimSun,Heiti SC Light,sans-serif}.A-HlBa_i18nFontFamily:lang(zh-Hant){font-family:adobe-clean-han-traditional,source-han-traditional,MingLiu,Microsoft JhengHei UI,Microsoft JhengHei,Heiti TC Light,sans-serif}.A-HlBa_i18nFontFamily:lang(zh-SG),.A-HlBa_i18nFontFamily:lang(zh-CN){font-family:adobe-clean-han-simplified-c,source-han-simplified-c,SimSun,Heiti SC Light,sans-serif}.A-HlBa_i18nFontFamily:lang(ko){font-family:adobe-clean-han-korean,source-han-korean,Malgun Gothic,Apple Gothic,sans-serif}.A-HlBa_i18nFontFamily:lang(ja){font-family:adobe-clean-han-japanese,Hiragino Kaku Gothic ProN,ヒラギノ角ゴ ProN W3,Osaka,YuGothic,Yu Gothic,メイリオ,Meiryo,MS Pゴシック,MS PGothic,sans-serif}.A-HlBa_spectrum-FocusRing-ring{--spectrum-focus-ring-border-radius:var(--spectrum-textfield-border-radius,var(--spectrum-alias-border-radius-regular));--spectrum-focus-ring-gap:var(--spectrum-alias-input-focusring-gap);--spectrum-focus-ring-size:var(--spectrum-alias-input-focusring-size);--spectrum-focus-ring-border-size:0px;--spectrum-focus-ring-color:var(--spectrum-high-contrast-focus-ring-color,var(--spectrum-alias-focus-ring-color,var(--spectrum-alias-focus-color)))}.A-HlBa_spectrum-FocusRing-ring:after{border-radius:calc(var(--spectrum-focus-ring-border-radius) + var(--spectrum-focus-ring-gap));content:"";margin:calc(-1*var(--spectrum-focus-ring-border-size));pointer-events:none;transition:box-shadow var(--spectrum-global-animation-duration-100,.13s)ease-out,margin var(--spectrum-global-animation-duration-100,.13s)ease-out;display:block;position:absolute;top:0;bottom:0;left:0;right:0}.A-HlBa_spectrum-FocusRing.A-HlBa_focus-ring:after{margin:calc(var(--spectrum-focus-ring-gap)*-1 - var(--spectrum-focus-ring-border-size));box-shadow:0 0 0 var(--spectrum-focus-ring-size)var(--spectrum-focus-ring-color)}.A-HlBa_spectrum-FocusRing--quiet:after{border-radius:0}.A-HlBa_spectrum-FocusRing--quiet.A-HlBa_focus-ring:after{margin:0 0 calc(var(--spectrum-focus-ring-gap)*-1 - var(--spectrum-focus-ring-border-size))0;box-shadow:0 var(--spectrum-focus-ring-size)0 var(--spectrum-focus-ring-color)}.A-HlBa_spectrum-FieldLabel{box-sizing:border-box;padding:var(--spectrum-fieldlabel-padding-top,var(--spectrum-global-dimension-size-50))0 var(--spectrum-fieldlabel-padding-bottom,var(--spectrum-global-dimension-size-65));font-size:var(--spectrum-fieldlabel-text-size,var(--spectrum-global-dimension-font-size-75));font-weight:var(--spectrum-fieldlabel-text-font-weight,var(--spectrum-global-font-weight-regular));line-height:var(--spectrum-fieldlabel-text-line-height,var(--spectrum-global-font-line-height-small));vertical-align:top;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;font-smoothing:subpixel-antialiased;text-align:start;cursor:default;flex:none;display:flex}.A-HlBa_spectrum-FieldLabel--positionSide{padding-top:var(--spectrum-fieldlabel-side-padding-top,var(--spectrum-global-dimension-size-100));display:inline-flex}.A-HlBa_spectrum-FieldLabel--positionSide:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-FieldLabel--positionSide:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-FieldLabel--positionSide:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-FieldLabel--positionSide:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){padding-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-FieldLabel--positionSide:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){padding-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-FieldLabel-requiredIcon{margin-top:var(--spectrum-fieldlabel-asterisk-margin-y,var(--spectrum-global-dimension-size-50));margin-bottom:0}.A-HlBa_spectrum-FieldLabel-requiredIcon:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:0;margin-left:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.A-HlBa_spectrum-FieldLabel-requiredIcon:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:0;margin-left:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.A-HlBa_spectrum-FieldLabel-requiredIcon:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:0;margin-left:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.A-HlBa_spectrum-FieldLabel-requiredIcon:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:0;margin-right:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.A-HlBa_spectrum-FieldLabel-requiredIcon:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:0;margin-right:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.A-HlBa_spectrum-FieldLabel--alignEnd{text-align:end;justify-content:flex-end}.A-HlBa_spectrum-Field{--spectrum-field-default-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400));height:max-content}.A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-contextualHelp{margin-top:var(--spectrum-global-dimension-size-25);grid-area:A-HlBa_contextualHelp}.A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-contextualHelp:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-left:var(--spectrum-global-dimension-size-50)}.A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-contextualHelp:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-left:var(--spectrum-global-dimension-size-50)}.A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-contextualHelp:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-left:var(--spectrum-global-dimension-size-50)}.A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-contextualHelp:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-right:var(--spectrum-global-dimension-size-50)}.A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-contextualHelp:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-right:var(--spectrum-global-dimension-size-50)}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop){width:var(--spectrum-field-default-width);grid-template:"A-HlBa_label A-HlBa_contextualHelp.""A-HlBa_field A-HlBa_field A-HlBa_field"1fr"A-HlBa_helpText A-HlBa_helpText A-HlBa_helpText"/auto auto minmax(0,1fr);align-content:start;display:inline-grid}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop) .A-HlBa_spectrum-Field-field{grid-area:A-HlBa_field;width:100%}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop).A-HlBa_spectrum-Field--alignEnd{grid-template-columns:1fr auto 0}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop) .A-HlBa_spectrum-FieldLabel{grid-area:A-HlBa_label}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide){align-items:flex-start;display:inline-flex}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-wrapper{width:var(--spectrum-field-default-width);flex:1;min-width:0;height:100%}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-wrapper .A-HlBa_spectrum-Field-field{width:100%}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-field{flex:1;min-width:0}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp{margin-top:var(--spectrum-global-dimension-size-65)}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){margin-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){margin-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-FieldLabel:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-right:0}.A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-FieldLabel:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-right:0}.A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-FieldLabel:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){padding-right:0}.A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-FieldLabel:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){padding-left:0}.A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-FieldLabel:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){padding-left:0}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide{border-collapse:separate;border-spacing:0 var(--spectrum-global-dimension-size-300);margin:calc(var(--spectrum-global-dimension-size-250)*-1)0;text-align:start;display:table}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field{width:100%;display:table-row}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field:not(.A-HlBa_spectrum-Field--hasContextualHelp) .A-HlBa_spectrum-FieldLabel,.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-Field-labelCell{display:table-cell}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-labelCell{vertical-align:top}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--alignEnd .A-HlBa_spectrum-Field-labelCell{text-align:end}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-labelWrapper{display:inline-flex}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-labelWrapper .A-HlBa_spectrum-FieldLabel{flex:1}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field-wrapper{width:100%}.A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field-field{min-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400));width:auto}.A-HlBa_spectrum-Form:where(.A-HlBa_spectrum-Form--positionTop){min-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400));flex-direction:column;margin:0;display:flex}.A-HlBa_spectrum-Form:where(.A-HlBa_spectrum-Form--positionTop)>*{margin-top:var(--spectrum-global-dimension-size-100);width:100%}.A-HlBa_spectrum-LabeledValue.A-HlBa_spectrum-Field--positionSide{align-items:baseline}.A-HlBa_spectrum-LabeledValue.A-HlBa_spectrum-Field--positionSide .A-HlBa_spectrum-Field-contextualHelp{top:var(--spectrum-global-dimension-size-40);margin-top:var(--spectrum-global-dimension-size-65);position:relative}.A-HlBa_spectrum-LabeledValue.A-HlBa_spectrum-Field--positionTop{width:unset}.A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-FieldLabel.A-HlBa_spectrum-FieldLabel{padding-top:0}.A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-Field-wrapper.A-HlBa_spectrum-Field-wrapper{width:unset}.A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-Field-field{word-break:break-word;overflow:hidden}.A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-Field-contextualHelp{margin-top:calc(-1*var(--spectrum-global-dimension-size-25))}.A-HlBa_spectrum-FieldLabel,.A-HlBa_spectrum-Form-itemLabel{color:var(--spectrum-fieldlabel-text-color,var(--spectrum-alias-label-text-color))}:-webkit-any(.A-HlBa_spectrum-FieldLabel,.A-HlBa_spectrum-Form-itemLabel).A-HlBa_is-disabled{color:var(--spectrum-fieldlabel-text-color-disabled,var(--spectrum-alias-text-color-disabled))}:is(.A-HlBa_spectrum-FieldLabel,.A-HlBa_spectrum-Form-itemLabel).A-HlBa_is-disabled{color:var(--spectrum-fieldlabel-text-color-disabled,var(--spectrum-alias-text-color-disabled))}
1
+ .A-HlBa_i18nFontFamily {
2
+ font-synthesis: weight;
3
+ font-family: adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
4
+ }
5
+
6
+ .A-HlBa_i18nFontFamily:lang(ar) {
7
+ font-family: myriad-arabic, adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
8
+ }
9
+
10
+ .A-HlBa_i18nFontFamily:lang(he) {
11
+ font-family: myriad-hebrew, adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
12
+ }
13
+
14
+ .A-HlBa_i18nFontFamily:lang(zh) {
15
+ font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
16
+ }
17
+
18
+ .A-HlBa_i18nFontFamily:lang(zh-Hans) {
19
+ font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
20
+ }
21
+
22
+ .A-HlBa_i18nFontFamily:lang(zh-Hant) {
23
+ font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
24
+ }
25
+
26
+ .A-HlBa_i18nFontFamily:lang(zh-SG) {
27
+ font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
28
+ }
29
+
30
+ .A-HlBa_i18nFontFamily:lang(zh-CN) {
31
+ font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
32
+ }
33
+
34
+ .A-HlBa_i18nFontFamily:lang(ko) {
35
+ font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
36
+ }
37
+
38
+ .A-HlBa_i18nFontFamily:lang(ja) {
39
+ font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
40
+ }
41
+
42
+ .A-HlBa_spectrum-FocusRing-ring {
43
+ --spectrum-focus-ring-border-radius: var(--spectrum-textfield-border-radius, var(--spectrum-alias-border-radius-regular));
44
+ --spectrum-focus-ring-gap: var(--spectrum-alias-input-focusring-gap);
45
+ --spectrum-focus-ring-size: var(--spectrum-alias-input-focusring-size);
46
+ --spectrum-focus-ring-border-size: 0px;
47
+ --spectrum-focus-ring-color: var(--spectrum-high-contrast-focus-ring-color, var(--spectrum-alias-focus-ring-color, var(--spectrum-alias-focus-color)));
48
+ }
49
+
50
+ .A-HlBa_spectrum-FocusRing-ring:after {
51
+ border-radius: calc(var(--spectrum-focus-ring-border-radius) + var(--spectrum-focus-ring-gap));
52
+ content: "";
53
+ margin: calc(-1 * var(--spectrum-focus-ring-border-size));
54
+ pointer-events: none;
55
+ transition: box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out, margin var(--spectrum-global-animation-duration-100, .13s) ease-out;
56
+ display: block;
57
+ position: absolute;
58
+ top: 0;
59
+ bottom: 0;
60
+ left: 0;
61
+ right: 0;
62
+ }
63
+
64
+ .A-HlBa_spectrum-FocusRing {
65
+ }
66
+
67
+ .A-HlBa_spectrum-FocusRing.A-HlBa_focus-ring:after {
68
+ margin: calc(var(--spectrum-focus-ring-gap) * -1 - var(--spectrum-focus-ring-border-size));
69
+ box-shadow: 0 0 0 var(--spectrum-focus-ring-size) var(--spectrum-focus-ring-color);
70
+ }
71
+
72
+ .A-HlBa_spectrum-FocusRing--quiet:after {
73
+ border-radius: 0;
74
+ }
75
+
76
+ .A-HlBa_spectrum-FocusRing--quiet.A-HlBa_focus-ring:after {
77
+ margin: 0 0 calc(var(--spectrum-focus-ring-gap) * -1 - var(--spectrum-focus-ring-border-size)) 0;
78
+ box-shadow: 0 var(--spectrum-focus-ring-size) 0 var(--spectrum-focus-ring-color);
79
+ }
80
+
81
+ .A-HlBa_spectrum-FieldLabel {
82
+ box-sizing: border-box;
83
+ padding: var(--spectrum-fieldlabel-padding-top, var(--spectrum-global-dimension-size-50)) 0 var(--spectrum-fieldlabel-padding-bottom, var(--spectrum-global-dimension-size-65));
84
+ font-size: var(--spectrum-fieldlabel-text-size, var(--spectrum-global-dimension-font-size-75));
85
+ font-weight: var(--spectrum-fieldlabel-text-font-weight, var(--spectrum-global-font-weight-regular));
86
+ line-height: var(--spectrum-fieldlabel-text-line-height, var(--spectrum-global-font-line-height-small));
87
+ vertical-align: top;
88
+ -webkit-font-smoothing: subpixel-antialiased;
89
+ -moz-osx-font-smoothing: auto;
90
+ font-smoothing: subpixel-antialiased;
91
+ text-align: start;
92
+ cursor: default;
93
+ flex: none;
94
+ display: flex;
95
+ }
96
+
97
+ .A-HlBa_spectrum-FieldLabel--positionSide {
98
+ padding-top: var(--spectrum-fieldlabel-side-padding-top, var(--spectrum-global-dimension-size-100));
99
+ padding-inline-end: var(--spectrum-fieldlabel-side-padding-x, var(--spectrum-global-dimension-size-100));
100
+ display: inline-flex;
101
+ }
102
+
103
+ .A-HlBa_spectrum-FieldLabel-requiredIcon {
104
+ margin-top: var(--spectrum-fieldlabel-asterisk-margin-y, var(--spectrum-global-dimension-size-50));
105
+ margin-inline-end: 0;
106
+ margin-bottom: 0;
107
+ margin-inline-start: var(--spectrum-fieldlabel-asterisk-gap, var(--spectrum-global-dimension-size-25));
108
+ }
109
+
110
+ .A-HlBa_spectrum-FieldLabel--alignEnd {
111
+ text-align: end;
112
+ justify-content: flex-end;
113
+ }
114
+
115
+ .A-HlBa_spectrum-Field {
116
+ --spectrum-field-default-width: var(--spectrum-alias-single-line-width, var(--spectrum-global-dimension-size-2400));
117
+ height: max-content;
118
+ }
119
+
120
+ .A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-contextualHelp {
121
+ margin-inline-start: var(--spectrum-global-dimension-size-50);
122
+ margin-top: var(--spectrum-global-dimension-size-25);
123
+ grid-area: A-HlBa_contextualHelp;
124
+ }
125
+
126
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop) {
127
+ width: var(--spectrum-field-default-width);
128
+ grid-template: "A-HlBa_label A-HlBa_contextualHelp ."
129
+ "A-HlBa_field A-HlBa_field A-HlBa_field" 1fr
130
+ "A-HlBa_helpText A-HlBa_helpText A-HlBa_helpText"
131
+ / auto auto minmax(0, 1fr);
132
+ align-content: start;
133
+ display: inline-grid;
134
+ }
135
+
136
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop) .A-HlBa_spectrum-Field-field {
137
+ grid-area: A-HlBa_field;
138
+ width: 100%;
139
+ }
140
+
141
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop).A-HlBa_spectrum-Field--alignEnd {
142
+ grid-template-columns: 1fr auto 0;
143
+ }
144
+
145
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionTop) .A-HlBa_spectrum-FieldLabel {
146
+ grid-area: A-HlBa_label;
147
+ }
148
+
149
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) {
150
+ align-items: flex-start;
151
+ display: inline-flex;
152
+ }
153
+
154
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-wrapper {
155
+ width: var(--spectrum-field-default-width);
156
+ flex: 1;
157
+ min-width: 0;
158
+ height: 100%;
159
+ }
160
+
161
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-wrapper .A-HlBa_spectrum-Field-field {
162
+ width: 100%;
163
+ }
164
+
165
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-field {
166
+ flex: 1;
167
+ min-width: 0;
168
+ }
169
+
170
+ .A-HlBa_spectrum-Field:where(.A-HlBa_spectrum-Field--positionSide) .A-HlBa_spectrum-Field-contextualHelp {
171
+ margin-top: var(--spectrum-global-dimension-size-65);
172
+ margin-inline-end: var(--spectrum-fieldlabel-side-padding-x, var(--spectrum-global-dimension-size-100));
173
+ }
174
+
175
+ .A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-FieldLabel {
176
+ padding-inline-end: 0;
177
+ }
178
+
179
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide {
180
+ border-collapse: separate;
181
+ border-spacing: 0 var(--spectrum-global-dimension-size-300);
182
+ margin: calc(var(--spectrum-global-dimension-size-250) * -1) 0;
183
+ text-align: start;
184
+ display: table;
185
+ }
186
+
187
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field {
188
+ width: 100%;
189
+ display: table-row;
190
+ }
191
+
192
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field:not(.A-HlBa_spectrum-Field--hasContextualHelp) .A-HlBa_spectrum-FieldLabel {
193
+ display: table-cell;
194
+ }
195
+
196
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--hasContextualHelp .A-HlBa_spectrum-Field-labelCell {
197
+ display: table-cell;
198
+ }
199
+
200
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-labelCell {
201
+ vertical-align: top;
202
+ }
203
+
204
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field.A-HlBa_spectrum-Field--alignEnd .A-HlBa_spectrum-Field-labelCell {
205
+ text-align: end;
206
+ }
207
+
208
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-labelWrapper {
209
+ display: inline-flex;
210
+ }
211
+
212
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field .A-HlBa_spectrum-Field-labelWrapper .A-HlBa_spectrum-FieldLabel {
213
+ flex: 1;
214
+ }
215
+
216
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field-wrapper {
217
+ width: 100%;
218
+ }
219
+
220
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionSide .A-HlBa_spectrum-Field-field {
221
+ min-width: var(--spectrum-alias-single-line-width, var(--spectrum-global-dimension-size-2400));
222
+ width: auto;
223
+ }
224
+
225
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionTop {
226
+ min-width: var(--spectrum-alias-single-line-width, var(--spectrum-global-dimension-size-2400));
227
+ flex-direction: column;
228
+ margin: 0;
229
+ display: flex;
230
+ }
231
+
232
+ .A-HlBa_spectrum-Form.A-HlBa_spectrum-Form--positionTop > * {
233
+ margin-top: var(--spectrum-global-dimension-size-100);
234
+ width: 100%;
235
+ }
236
+
237
+ .A-HlBa_spectrum-LabeledValue.A-HlBa_spectrum-Field--positionSide {
238
+ align-items: baseline;
239
+ }
240
+
241
+ .A-HlBa_spectrum-LabeledValue.A-HlBa_spectrum-Field--positionSide .A-HlBa_spectrum-Field-contextualHelp {
242
+ top: var(--spectrum-global-dimension-size-40);
243
+ margin-top: var(--spectrum-global-dimension-size-65);
244
+ position: relative;
245
+ }
246
+
247
+ .A-HlBa_spectrum-LabeledValue.A-HlBa_spectrum-Field--positionTop {
248
+ width: unset;
249
+ }
250
+
251
+ .A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-FieldLabel.A-HlBa_spectrum-FieldLabel {
252
+ padding-top: 0;
253
+ }
254
+
255
+ .A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-Field-wrapper.A-HlBa_spectrum-Field-wrapper {
256
+ width: unset;
257
+ }
258
+
259
+ .A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-Field-field {
260
+ word-break: break-word;
261
+ overflow: hidden;
262
+ }
263
+
264
+ .A-HlBa_spectrum-LabeledValue .A-HlBa_spectrum-Field-contextualHelp {
265
+ margin-top: calc(-1 * var(--spectrum-global-dimension-size-25));
266
+ }
267
+
268
+ .A-HlBa_spectrum-FieldLabel, .A-HlBa_spectrum-Form-itemLabel {
269
+ color: var(--spectrum-fieldlabel-text-color, var(--spectrum-alias-label-text-color));
270
+ }
271
+
272
+ :is(.A-HlBa_spectrum-FieldLabel, .A-HlBa_spectrum-Form-itemLabel).A-HlBa_is-disabled {
273
+ color: var(--spectrum-fieldlabel-text-color-disabled, var(--spectrum-alias-text-color-disabled));
274
+ }
275
+
276
+ /*# sourceMappingURL=main.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;;;;AAiBF;;;AAII;;;;;AAQF;;;;AAKE;;;;;AAOJ;;;;;;;;;;;;;;;;AAsBA;;;;;;AAMA;;;;;;;AAOA;;;;;AAUA;;;;;AAIE;;;;;;AAMA;;;;;;;;;;AAUE;;;;;AAMA;;;;AAIA;;;;AAOF;;;;;AAKE;;;;;;;AAaE;;;;AAMF;;;;;AAKA;;;;;AAOA;;;;AAaF;;;;;;;;AAOE;;;;;AAME;;;;AAAA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAGE;;;;AAMJ;;;;AAIA;;;;;AAOF;;;;;;;AASE;;;;;AASF;;;;AAGE;;;;;;AAOF;;;;AAIA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;AAkBF;;;;AAIE","sources":["packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.css.map"}
package/dist/main.js CHANGED
@@ -1,12 +1,17 @@
1
+ "use client";
2
+
1
3
  require("./main.css");
2
4
  var $eLNG1$reactspectrumutils = require("@react-spectrum/utils");
3
5
  var $eLNG1$reactariautils = require("@react-aria/utils");
6
+ var $eLNG1$reactstatelyform = require("@react-stately/form");
4
7
  var $eLNG1$reactspectrumprovider = require("@react-spectrum/provider");
5
8
  var $eLNG1$react = require("react");
6
9
 
10
+
7
11
  function $parcel$export(e, n, v, s) {
8
12
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
13
  }
14
+
10
15
  function $parcel$interopDefault(a) {
11
16
  return a && a.__esModule ? a.default : a;
12
17
  }
@@ -38,6 +43,7 @@ $parcel$export(module.exports, "Form", () => $d981bcab8e24f2f3$export$a7fed597f4
38
43
 
39
44
 
40
45
 
46
+
41
47
  var $eb2fc0ee655eff6b$exports = {};
42
48
 
43
49
  $parcel$export($eb2fc0ee655eff6b$exports, "contextualHelp", () => $eb2fc0ee655eff6b$export$4ba534aba1836d, (v) => $eb2fc0ee655eff6b$export$4ba534aba1836d = v);
@@ -144,17 +150,20 @@ const $d981bcab8e24f2f3$var$formPropNames = new Set([
144
150
  "encType",
145
151
  "method",
146
152
  "target",
147
- "onSubmit"
153
+ "onSubmit",
154
+ "onReset",
155
+ "onInvalid"
148
156
  ]);
149
157
  function $d981bcab8e24f2f3$var$Form(props, ref) {
150
158
  props = (0, $eLNG1$reactspectrumprovider.useProviderProps)(props);
151
- let { children: children, labelPosition: labelPosition = "top", labelAlign: labelAlign = "start", isRequired: isRequired, necessityIndicator: necessityIndicator, isQuiet: isQuiet, isEmphasized: isEmphasized, isDisabled: isDisabled, isReadOnly: isReadOnly, validationState: validationState, ...otherProps } = props;
159
+ let { children: children, labelPosition: labelPosition = "top", labelAlign: labelAlign = "start", isRequired: isRequired, necessityIndicator: necessityIndicator, isQuiet: isQuiet, isEmphasized: isEmphasized, isDisabled: isDisabled, isReadOnly: isReadOnly, validationState: validationState, validationBehavior: validationBehavior, validationErrors: validationErrors, ...otherProps } = props;
152
160
  let { styleProps: styleProps } = (0, $eLNG1$reactspectrumutils.useStyleProps)(otherProps);
153
161
  let domRef = (0, $eLNG1$reactspectrumutils.useDOMRef)(ref);
154
162
  let ctx = {
155
163
  labelPosition: labelPosition,
156
164
  labelAlign: labelAlign,
157
- necessityIndicator: necessityIndicator
165
+ necessityIndicator: necessityIndicator,
166
+ validationBehavior: validationBehavior
158
167
  };
159
168
  return /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement("form", {
160
169
  ...(0, $eLNG1$reactariautils.filterDOMProps)(otherProps, {
@@ -162,7 +171,7 @@ function $d981bcab8e24f2f3$var$Form(props, ref) {
162
171
  propNames: $d981bcab8e24f2f3$var$formPropNames
163
172
  }),
164
173
  ...styleProps,
165
- noValidate: true,
174
+ noValidate: validationBehavior !== "native",
166
175
  ref: domRef,
167
176
  className: (0, $eLNG1$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($eb2fc0ee655eff6b$exports))), "spectrum-Form", {
168
177
  "spectrum-Form--positionSide": labelPosition === "side",
@@ -177,7 +186,9 @@ function $d981bcab8e24f2f3$var$Form(props, ref) {
177
186
  isReadOnly: isReadOnly,
178
187
  isRequired: isRequired,
179
188
  validationState: validationState
180
- }, children)));
189
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement((0, $eLNG1$reactstatelyform.FormValidationContext).Provider, {
190
+ value: validationErrors || {}
191
+ }, children))));
181
192
  }
182
193
  /**
183
194
  * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":"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","sources":["packages/@react-spectrum/form/src/index.ts","packages/@react-spectrum/form/src/Form.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport {useFormProps, Form} from './Form';\nexport type {SpectrumFormProps} from '@react-types/form';\n","/*\n * Copyright 2020 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 {Alignment, DOMRef, LabelPosition, SpectrumLabelableProps} from '@react-types/shared';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useContext} from 'react';\nimport {SpectrumFormProps} from '@react-types/form';\nimport styles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\n\nlet FormContext = React.createContext<SpectrumLabelableProps>(null);\nexport function useFormProps<T extends SpectrumLabelableProps>(props: T): T {\n let ctx = useContext(FormContext);\n if (ctx) {\n return {...ctx, ...props};\n }\n\n return props;\n}\n\nconst formPropNames = new Set([\n 'action',\n 'autoComplete',\n 'encType',\n 'method',\n 'target',\n 'onSubmit'\n]);\n\nfunction Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {\n props = useProviderProps(props);\n let {\n children,\n labelPosition = 'top' as LabelPosition,\n labelAlign = 'start' as Alignment,\n isRequired,\n necessityIndicator,\n isQuiet,\n isEmphasized,\n isDisabled,\n isReadOnly,\n validationState,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let ctx = {\n labelPosition,\n labelAlign,\n necessityIndicator\n };\n\n return (\n <form\n {...filterDOMProps(otherProps, {labelable: true, propNames: formPropNames})}\n {...styleProps}\n noValidate\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Form',\n {\n 'spectrum-Form--positionSide': labelPosition === 'side',\n 'spectrum-Form--positionTop': labelPosition === 'top'\n },\n styleProps.className\n )\n }>\n <FormContext.Provider value={ctx}>\n <Provider\n isQuiet={isQuiet}\n isEmphasized={isEmphasized}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n validationState={validationState}>\n {children}\n </Provider>\n </FormContext.Provider>\n </form>\n );\n}\n\n/**\n * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.\n */\nconst _Form = React.forwardRef(Form);\nexport {_Form as Form};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":"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","sources":["packages/@react-spectrum/form/src/index.ts","packages/@react-spectrum/form/src/Form.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport {useFormProps, Form} from './Form';\nexport type {SpectrumFormProps} from '@react-types/form';\n","/*\n * Copyright 2020 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 {Alignment, DOMRef, LabelPosition, SpectrumLabelableProps} from '@react-types/shared';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormValidationContext} from '@react-stately/form';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useContext} from 'react';\nimport {SpectrumFormProps} from '@react-types/form';\nimport styles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\n\ninterface FormContextValue extends SpectrumLabelableProps {\n validationBehavior?: 'aria' | 'native'\n}\n\nlet FormContext = React.createContext<FormContextValue | null>(null);\nexport function useFormProps<T extends SpectrumLabelableProps>(props: T): T {\n let ctx = useContext(FormContext);\n if (ctx) {\n return {...ctx, ...props};\n }\n\n return props;\n}\n\nconst formPropNames = new Set([\n 'action',\n 'autoComplete',\n 'encType',\n 'method',\n 'target',\n 'onSubmit',\n 'onReset',\n 'onInvalid'\n]);\n\nfunction Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {\n props = useProviderProps(props);\n let {\n children,\n labelPosition = 'top' as LabelPosition,\n labelAlign = 'start' as Alignment,\n isRequired,\n necessityIndicator,\n isQuiet,\n isEmphasized,\n isDisabled,\n isReadOnly,\n validationState,\n validationBehavior,\n validationErrors,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let ctx = {\n labelPosition,\n labelAlign,\n necessityIndicator,\n validationBehavior\n };\n\n return (\n <form\n {...filterDOMProps(otherProps, {labelable: true, propNames: formPropNames})}\n {...styleProps}\n noValidate={validationBehavior !== 'native'}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Form',\n {\n 'spectrum-Form--positionSide': labelPosition === 'side',\n 'spectrum-Form--positionTop': labelPosition === 'top'\n },\n styleProps.className\n )\n }>\n <FormContext.Provider value={ctx}>\n <Provider\n isQuiet={isQuiet}\n isEmphasized={isEmphasized}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n validationState={validationState}>\n <FormValidationContext.Provider value={validationErrors || {}}>\n {children}\n </FormValidationContext.Provider>\n </Provider>\n </FormContext.Provider>\n </form>\n );\n}\n\n/**\n * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.\n */\nconst _Form = React.forwardRef(Form);\nexport {_Form as Form};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,12 +1,17 @@
1
+ "use client";
2
+
1
3
  import "./main.css";
2
4
  import {useStyleProps as $011V3$useStyleProps, useDOMRef as $011V3$useDOMRef, classNames as $011V3$classNames} from "@react-spectrum/utils";
3
5
  import {filterDOMProps as $011V3$filterDOMProps} from "@react-aria/utils";
6
+ import {FormValidationContext as $011V3$FormValidationContext} from "@react-stately/form";
4
7
  import {useProviderProps as $011V3$useProviderProps, Provider as $011V3$Provider} from "@react-spectrum/provider";
5
8
  import $011V3$react, {useContext as $011V3$useContext} from "react";
6
9
 
10
+
7
11
  function $parcel$interopDefault(a) {
8
12
  return a && a.__esModule ? a.default : a;
9
13
  }
14
+
10
15
  function $parcel$export(e, n, v, s) {
11
16
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
17
  }
@@ -35,6 +40,7 @@ function $parcel$export(e, n, v, s) {
35
40
 
36
41
 
37
42
 
43
+
38
44
  var $cd231e464c886c86$exports = {};
39
45
 
40
46
  $parcel$export($cd231e464c886c86$exports, "contextualHelp", () => $cd231e464c886c86$export$4ba534aba1836d, (v) => $cd231e464c886c86$export$4ba534aba1836d = v);
@@ -141,17 +147,20 @@ const $ac118ceca79b8650$var$formPropNames = new Set([
141
147
  "encType",
142
148
  "method",
143
149
  "target",
144
- "onSubmit"
150
+ "onSubmit",
151
+ "onReset",
152
+ "onInvalid"
145
153
  ]);
146
154
  function $ac118ceca79b8650$var$Form(props, ref) {
147
155
  props = (0, $011V3$useProviderProps)(props);
148
- let { children: children, labelPosition: labelPosition = "top", labelAlign: labelAlign = "start", isRequired: isRequired, necessityIndicator: necessityIndicator, isQuiet: isQuiet, isEmphasized: isEmphasized, isDisabled: isDisabled, isReadOnly: isReadOnly, validationState: validationState, ...otherProps } = props;
156
+ let { children: children, labelPosition: labelPosition = "top", labelAlign: labelAlign = "start", isRequired: isRequired, necessityIndicator: necessityIndicator, isQuiet: isQuiet, isEmphasized: isEmphasized, isDisabled: isDisabled, isReadOnly: isReadOnly, validationState: validationState, validationBehavior: validationBehavior, validationErrors: validationErrors, ...otherProps } = props;
149
157
  let { styleProps: styleProps } = (0, $011V3$useStyleProps)(otherProps);
150
158
  let domRef = (0, $011V3$useDOMRef)(ref);
151
159
  let ctx = {
152
160
  labelPosition: labelPosition,
153
161
  labelAlign: labelAlign,
154
- necessityIndicator: necessityIndicator
162
+ necessityIndicator: necessityIndicator,
163
+ validationBehavior: validationBehavior
155
164
  };
156
165
  return /*#__PURE__*/ (0, $011V3$react).createElement("form", {
157
166
  ...(0, $011V3$filterDOMProps)(otherProps, {
@@ -159,7 +168,7 @@ function $ac118ceca79b8650$var$Form(props, ref) {
159
168
  propNames: $ac118ceca79b8650$var$formPropNames
160
169
  }),
161
170
  ...styleProps,
162
- noValidate: true,
171
+ noValidate: validationBehavior !== "native",
163
172
  ref: domRef,
164
173
  className: (0, $011V3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports))), "spectrum-Form", {
165
174
  "spectrum-Form--positionSide": labelPosition === "side",
@@ -174,7 +183,9 @@ function $ac118ceca79b8650$var$Form(props, ref) {
174
183
  isReadOnly: isReadOnly,
175
184
  isRequired: isRequired,
176
185
  validationState: validationState
177
- }, children)));
186
+ }, /*#__PURE__*/ (0, $011V3$react).createElement((0, $011V3$FormValidationContext).Provider, {
187
+ value: validationErrors || {}
188
+ }, children))));
178
189
  }
179
190
  /**
180
191
  * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
@@ -1 +1 @@
1
- {"mappings":"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","sources":["packages/@react-spectrum/form/src/index.ts","packages/@react-spectrum/form/src/Form.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport {useFormProps, Form} from './Form';\nexport type {SpectrumFormProps} from '@react-types/form';\n","/*\n * Copyright 2020 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 {Alignment, DOMRef, LabelPosition, SpectrumLabelableProps} from '@react-types/shared';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useContext} from 'react';\nimport {SpectrumFormProps} from '@react-types/form';\nimport styles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\n\nlet FormContext = React.createContext<SpectrumLabelableProps>(null);\nexport function useFormProps<T extends SpectrumLabelableProps>(props: T): T {\n let ctx = useContext(FormContext);\n if (ctx) {\n return {...ctx, ...props};\n }\n\n return props;\n}\n\nconst formPropNames = new Set([\n 'action',\n 'autoComplete',\n 'encType',\n 'method',\n 'target',\n 'onSubmit'\n]);\n\nfunction Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {\n props = useProviderProps(props);\n let {\n children,\n labelPosition = 'top' as LabelPosition,\n labelAlign = 'start' as Alignment,\n isRequired,\n necessityIndicator,\n isQuiet,\n isEmphasized,\n isDisabled,\n isReadOnly,\n validationState,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let ctx = {\n labelPosition,\n labelAlign,\n necessityIndicator\n };\n\n return (\n <form\n {...filterDOMProps(otherProps, {labelable: true, propNames: formPropNames})}\n {...styleProps}\n noValidate\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Form',\n {\n 'spectrum-Form--positionSide': labelPosition === 'side',\n 'spectrum-Form--positionTop': labelPosition === 'top'\n },\n styleProps.className\n )\n }>\n <FormContext.Provider value={ctx}>\n <Provider\n isQuiet={isQuiet}\n isEmphasized={isEmphasized}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n validationState={validationState}>\n {children}\n </Provider>\n </FormContext.Provider>\n </form>\n );\n}\n\n/**\n * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.\n */\nconst _Form = React.forwardRef(Form);\nexport {_Form as Form};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":"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","sources":["packages/@react-spectrum/form/src/index.ts","packages/@react-spectrum/form/src/Form.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport {useFormProps, Form} from './Form';\nexport type {SpectrumFormProps} from '@react-types/form';\n","/*\n * Copyright 2020 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 {Alignment, DOMRef, LabelPosition, SpectrumLabelableProps} from '@react-types/shared';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormValidationContext} from '@react-stately/form';\nimport {Provider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useContext} from 'react';\nimport {SpectrumFormProps} from '@react-types/form';\nimport styles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\n\ninterface FormContextValue extends SpectrumLabelableProps {\n validationBehavior?: 'aria' | 'native'\n}\n\nlet FormContext = React.createContext<FormContextValue | null>(null);\nexport function useFormProps<T extends SpectrumLabelableProps>(props: T): T {\n let ctx = useContext(FormContext);\n if (ctx) {\n return {...ctx, ...props};\n }\n\n return props;\n}\n\nconst formPropNames = new Set([\n 'action',\n 'autoComplete',\n 'encType',\n 'method',\n 'target',\n 'onSubmit',\n 'onReset',\n 'onInvalid'\n]);\n\nfunction Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {\n props = useProviderProps(props);\n let {\n children,\n labelPosition = 'top' as LabelPosition,\n labelAlign = 'start' as Alignment,\n isRequired,\n necessityIndicator,\n isQuiet,\n isEmphasized,\n isDisabled,\n isReadOnly,\n validationState,\n validationBehavior,\n validationErrors,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let ctx = {\n labelPosition,\n labelAlign,\n necessityIndicator,\n validationBehavior\n };\n\n return (\n <form\n {...filterDOMProps(otherProps, {labelable: true, propNames: formPropNames})}\n {...styleProps}\n noValidate={validationBehavior !== 'native'}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-Form',\n {\n 'spectrum-Form--positionSide': labelPosition === 'side',\n 'spectrum-Form--positionTop': labelPosition === 'top'\n },\n styleProps.className\n )\n }>\n <FormContext.Provider value={ctx}>\n <Provider\n isQuiet={isQuiet}\n isEmphasized={isEmphasized}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n validationState={validationState}>\n <FormValidationContext.Provider value={validationErrors || {}}>\n {children}\n </FormValidationContext.Provider>\n </Provider>\n </FormContext.Provider>\n </form>\n );\n}\n\n/**\n * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.\n */\nconst _Form = React.forwardRef(Form);\nexport {_Form as Form};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;AAqBA,6BAA6B,CAAC,SAAS,sBAAsB,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAO1E;AAoED;;GAEG;AACH,OAAA,MAAM,0IAA8B,CAAC;ACpFrC,YAAY,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC","sources":["packages/@react-spectrum/form/src/packages/@react-spectrum/form/src/Form.tsx","packages/@react-spectrum/form/src/packages/@react-spectrum/form/src/index.ts","packages/@react-spectrum/form/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport {useFormProps, Form} from './Form';\nexport type {SpectrumFormProps} from '@react-types/form';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AA0BA,6BAA6B,CAAC,SAAS,sBAAsB,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAO1E;AA2ED;;GAEG;AACH,OAAA,MAAM,0IAA8B,CAAC;AChGrC,YAAY,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC","sources":["packages/@react-spectrum/form/src/packages/@react-spectrum/form/src/Form.tsx","packages/@react-spectrum/form/src/packages/@react-spectrum/form/src/index.ts","packages/@react-spectrum/form/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport {useFormProps, Form} from './Form';\nexport type {SpectrumFormProps} from '@react-types/form';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/form",
3
- "version": "3.6.7",
3
+ "version": "3.7.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,10 +36,11 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/utils": "^3.21.1",
40
- "@react-spectrum/utils": "^3.11.1",
41
- "@react-types/form": "^3.5.4",
42
- "@react-types/shared": "^3.21.0",
39
+ "@react-aria/utils": "^3.23.0",
40
+ "@react-spectrum/utils": "^3.11.3",
41
+ "@react-stately/form": "^3.0.0",
42
+ "@react-types/form": "^3.7.0",
43
+ "@react-types/shared": "^3.22.0",
43
44
  "@swc/helpers": "^0.5.0"
44
45
  },
45
46
  "devDependencies": {
@@ -52,5 +53,5 @@
52
53
  "publishConfig": {
53
54
  "access": "public"
54
55
  },
55
- "gitHead": "3ecf62dcceea437cb12df1851636dd491bb6591c"
56
+ "gitHead": "86b38c87868ce7f262e0df905e5ac4eb2653791d"
56
57
  }
package/src/Form.tsx CHANGED
@@ -13,12 +13,17 @@
13
13
  import {Alignment, DOMRef, LabelPosition, SpectrumLabelableProps} from '@react-types/shared';
14
14
  import {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';
15
15
  import {filterDOMProps} from '@react-aria/utils';
16
+ import {FormValidationContext} from '@react-stately/form';
16
17
  import {Provider, useProviderProps} from '@react-spectrum/provider';
17
18
  import React, {useContext} from 'react';
18
19
  import {SpectrumFormProps} from '@react-types/form';
19
20
  import styles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';
20
21
 
21
- let FormContext = React.createContext<SpectrumLabelableProps>(null);
22
+ interface FormContextValue extends SpectrumLabelableProps {
23
+ validationBehavior?: 'aria' | 'native'
24
+ }
25
+
26
+ let FormContext = React.createContext<FormContextValue | null>(null);
22
27
  export function useFormProps<T extends SpectrumLabelableProps>(props: T): T {
23
28
  let ctx = useContext(FormContext);
24
29
  if (ctx) {
@@ -34,7 +39,9 @@ const formPropNames = new Set([
34
39
  'encType',
35
40
  'method',
36
41
  'target',
37
- 'onSubmit'
42
+ 'onSubmit',
43
+ 'onReset',
44
+ 'onInvalid'
38
45
  ]);
39
46
 
40
47
  function Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {
@@ -50,6 +57,8 @@ function Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {
50
57
  isDisabled,
51
58
  isReadOnly,
52
59
  validationState,
60
+ validationBehavior,
61
+ validationErrors,
53
62
  ...otherProps
54
63
  } = props;
55
64
 
@@ -59,14 +68,15 @@ function Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {
59
68
  let ctx = {
60
69
  labelPosition,
61
70
  labelAlign,
62
- necessityIndicator
71
+ necessityIndicator,
72
+ validationBehavior
63
73
  };
64
74
 
65
75
  return (
66
76
  <form
67
77
  {...filterDOMProps(otherProps, {labelable: true, propNames: formPropNames})}
68
78
  {...styleProps}
69
- noValidate
79
+ noValidate={validationBehavior !== 'native'}
70
80
  ref={domRef}
71
81
  className={
72
82
  classNames(
@@ -87,7 +97,9 @@ function Form(props: SpectrumFormProps, ref: DOMRef<HTMLFormElement>) {
87
97
  isReadOnly={isReadOnly}
88
98
  isRequired={isRequired}
89
99
  validationState={validationState}>
90
- {children}
100
+ <FormValidationContext.Provider value={validationErrors || {}}>
101
+ {children}
102
+ </FormValidationContext.Provider>
91
103
  </Provider>
92
104
  </FormContext.Provider>
93
105
  </form>