@react-spectrum/form 3.5.0 → 3.5.2
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/main.css +1 -1
- package/dist/main.js +46 -25
- package/dist/main.js.map +1 -1
- package/dist/module.js +46 -25
- package/dist/module.js.map +1 -1
- package/package.json +7 -7
package/dist/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[dir=ltr] .spectrum-FieldLabel_d2db1f{text-align:left}[dir=rtl] .spectrum-FieldLabel_d2db1f{text-align:right}.spectrum-FieldLabel_d2db1f{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;cursor:default;flex:none;display:flex}[dir=ltr] .spectrum-FieldLabel--positionSide_d2db1f{padding-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-FieldLabel--positionSide_d2db1f{padding-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-FieldLabel--positionSide_d2db1f{padding-top:var(--spectrum-fieldlabel-side-padding-top,var(--spectrum-global-dimension-size-100));display:inline-flex}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:0}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:0}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.spectrum-FieldLabel-requiredIcon_d2db1f{margin-top:var(--spectrum-fieldlabel-asterisk-margin-y,var(--spectrum-global-dimension-size-50));margin-bottom:0}[dir=ltr] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:right}[dir=rtl] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:left}.spectrum-FieldLabel--alignEnd_d2db1f{justify-content:flex-end}.spectrum-Field_d2db1f{--spectrum-field-default-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400))}.spectrum-Field_d2db1f.spectrum-Field--positionTop_d2db1f{display:-ms-inline-grid;-ms-grid-columns:auto auto minmax(0,1fr);width:var(--spectrum-field-default-width);grid-template
|
|
1
|
+
[dir=ltr] .spectrum-FieldLabel_d2db1f{text-align:left}[dir=rtl] .spectrum-FieldLabel_d2db1f{text-align:right}.spectrum-FieldLabel_d2db1f{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;cursor:default;flex:none;display:flex}[dir=ltr] .spectrum-FieldLabel--positionSide_d2db1f{padding-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-FieldLabel--positionSide_d2db1f{padding-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-FieldLabel--positionSide_d2db1f{padding-top:var(--spectrum-fieldlabel-side-padding-top,var(--spectrum-global-dimension-size-100));display:inline-flex}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:0}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:0}[dir=ltr] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-left:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}[dir=rtl] .spectrum-FieldLabel-requiredIcon_d2db1f{margin-right:var(--spectrum-fieldlabel-asterisk-gap,var(--spectrum-global-dimension-size-25))}.spectrum-FieldLabel-requiredIcon_d2db1f{margin-top:var(--spectrum-fieldlabel-asterisk-margin-y,var(--spectrum-global-dimension-size-50));margin-bottom:0}[dir=ltr] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:right}[dir=rtl] .spectrum-FieldLabel--alignEnd_d2db1f{text-align:left}.spectrum-FieldLabel--alignEnd_d2db1f{justify-content:flex-end}.spectrum-Field_d2db1f{--spectrum-field-default-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400))}[dir=ltr] .spectrum-Field_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-left:var(--spectrum-global-dimension-size-50)}[dir=rtl] .spectrum-Field_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-right:var(--spectrum-global-dimension-size-50)}.spectrum-Field_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-top:var(--spectrum-global-dimension-size-25);grid-area:contextualHelp}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f){display:-ms-inline-grid;-ms-grid-columns:auto auto minmax(0,1fr);-ms-grid-rows:auto 1fr auto;width:var(--spectrum-field-default-width);grid-template:"label contextualHelp.""field field field"1fr"helpText helpText helpText"/auto auto minmax(0,1fr);align-content:start;display:inline-grid}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f) .spectrum-Field-field_d2db1f{width:100%;grid-area:field}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f).spectrum-Field--alignEnd_d2db1f{-ms-grid-columns:1fr auto 0;grid-template-columns:1fr auto 0}.spectrum-Field_d2db1f:where(.spectrum-Field--positionTop_d2db1f) .spectrum-FieldLabel_d2db1f{grid-area:label}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f){align-items:flex-start;display:inline-flex}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-wrapper_d2db1f{min-width:0;width:var(--spectrum-field-default-width);height:100%;flex:1}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-wrapper_d2db1f .spectrum-Field-field_d2db1f{width:100%}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-field_d2db1f{min-width:0;flex:1}[dir=ltr] .spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-contextualHelp_d2db1f{margin-right:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}[dir=rtl] .spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-contextualHelp_d2db1f{margin-left:var(--spectrum-fieldlabel-side-padding-x,var(--spectrum-global-dimension-size-100))}.spectrum-Field_d2db1f:where(.spectrum-Field--positionSide_d2db1f) .spectrum-Field-contextualHelp_d2db1f{margin-top:var(--spectrum-global-dimension-size-65)}[dir=ltr] .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-FieldLabel_d2db1f{padding-right:0}[dir=rtl] .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-FieldLabel_d2db1f{padding-left:0}[dir=ltr] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f){text-align:left}[dir=rtl] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f){text-align:right}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f){border-collapse:separate;border-spacing:0 var(--spectrum-global-dimension-size-300);margin:calc(var(--spectrum-global-dimension-size-250)*-1)0;display:table}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f{width:100%;display:table-row}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f:not(.spectrum-Field--hasContextualHelp_d2db1f) .spectrum-FieldLabel_d2db1f,.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f.spectrum-Field--hasContextualHelp_d2db1f .spectrum-Field-labelCell_d2db1f{display:table-cell}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f .spectrum-Field-labelCell_d2db1f{vertical-align:top}[dir=ltr] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f.spectrum-Field--alignEnd_d2db1f .spectrum-Field-labelCell_d2db1f{text-align:right}[dir=rtl] .spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f.spectrum-Field--alignEnd_d2db1f .spectrum-Field-labelCell_d2db1f{text-align:left}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f .spectrum-Field-labelWrapper_d2db1f{display:inline-flex}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field_d2db1f .spectrum-Field-labelWrapper_d2db1f .spectrum-FieldLabel_d2db1f{flex:1}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field-wrapper_d2db1f{width:100%}.spectrum-Form_d2db1f:where(.spectrum-Form--positionSide_d2db1f) .spectrum-Field-field_d2db1f{width:auto;min-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400))}.spectrum-Form_d2db1f:where(.spectrum-Form--positionTop_d2db1f){min-width:var(--spectrum-alias-single-line-width,var(--spectrum-global-dimension-size-2400));flex-direction:column;margin:0;display:flex}.spectrum-Form_d2db1f:where(.spectrum-Form--positionTop_d2db1f)>*{margin-top:var(--spectrum-global-dimension-size-100);width:100%}.spectrum-LabeledValue_d2db1f.spectrum-Field--positionSide_d2db1f{-ms-flex-align:first baseline;align-items:baseline}.spectrum-LabeledValue_d2db1f.spectrum-Field--positionSide_d2db1f .spectrum-Field-contextualHelp_d2db1f{top:var(--spectrum-global-dimension-size-40);margin-top:var(--spectrum-global-dimension-size-65);position:relative}.spectrum-LabeledValue_d2db1f.spectrum-Field--positionTop_d2db1f{width:unset}.spectrum-LabeledValue_d2db1f .spectrum-FieldLabel_d2db1f.spectrum-FieldLabel_d2db1f{padding-top:0}.spectrum-LabeledValue_d2db1f .spectrum-Field-wrapper_d2db1f.spectrum-Field-wrapper_d2db1f{width:unset}.spectrum-LabeledValue_d2db1f .spectrum-Field-field_d2db1f{word-break:break-word;overflow:hidden}.spectrum-LabeledValue_d2db1f .spectrum-Field-contextualHelp_d2db1f{margin-top:calc(-1*var(--spectrum-global-dimension-size-25))}.spectrum-FieldLabel_d2db1f,.spectrum-Form-itemLabel_d2db1f{color:var(--spectrum-fieldlabel-text-color,var(--spectrum-alias-label-text-color))}.spectrum-FieldLabel_d2db1f.is-disabled_d2db1f,.spectrum-Form-itemLabel_d2db1f.is-disabled_d2db1f{color:var(--spectrum-fieldlabel-text-color-disabled,var(--spectrum-alias-text-color-disabled))}.spectrum-FieldLabel_d2db1f.is-disabled_d2db1f .spectrum-FieldLabel-requiredIcon_d2db1f,.spectrum-Form-itemLabel_d2db1f.is-disabled_d2db1f .spectrum-FieldLabel-requiredIcon_d2db1f{color:var(--spectrum-fieldlabel-asterisk-color-disabled,var(--spectrum-alias-text-color-disabled))}.spectrum-FieldLabel-requiredIcon_d2db1f{color:var(--spectrum-fieldlabel-asterisk-color,var(--spectrum-global-color-gray-600))}
|
package/dist/main.js
CHANGED
|
@@ -13,7 +13,28 @@ function $parcel$interopDefault(a) {
|
|
|
13
13
|
|
|
14
14
|
$parcel$export(module.exports, "useFormProps", () => $d981bcab8e24f2f3$export$a6b5be5c6b451665);
|
|
15
15
|
$parcel$export(module.exports, "Form", () => $d981bcab8e24f2f3$export$a7fed597f4b8afd8);
|
|
16
|
-
|
|
16
|
+
/*
|
|
17
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
18
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
19
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
20
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
*
|
|
22
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
23
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
24
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
25
|
+
* governing permissions and limitations under the License.
|
|
26
|
+
*/ /// <reference types="css-module-types" />
|
|
27
|
+
/*
|
|
28
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
29
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
30
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
31
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
32
|
+
*
|
|
33
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
34
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
35
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
36
|
+
* governing permissions and limitations under the License.
|
|
37
|
+
*/
|
|
17
38
|
|
|
18
39
|
|
|
19
40
|
|
|
@@ -24,12 +45,12 @@ $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--positionSide", (
|
|
|
24
45
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel-requiredIcon", () => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9, (v) => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = v);
|
|
25
46
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--alignEnd", () => $eb2fc0ee655eff6b$export$885efcc08143a987, (v) => $eb2fc0ee655eff6b$export$885efcc08143a987 = v);
|
|
26
47
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field", () => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0, (v) => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = v);
|
|
48
|
+
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-contextualHelp", () => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f, (v) => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = v);
|
|
27
49
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionTop", () => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9, (v) => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = v);
|
|
28
50
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-field", () => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d, (v) => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = v);
|
|
29
51
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--alignEnd", () => $eb2fc0ee655eff6b$export$5354c9be7ada5f83, (v) => $eb2fc0ee655eff6b$export$5354c9be7ada5f83 = v);
|
|
30
52
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionSide", () => $eb2fc0ee655eff6b$export$2963225c91179589, (v) => $eb2fc0ee655eff6b$export$2963225c91179589 = v);
|
|
31
53
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-wrapper", () => $eb2fc0ee655eff6b$export$127df0b7290eb8ef, (v) => $eb2fc0ee655eff6b$export$127df0b7290eb8ef = v);
|
|
32
|
-
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-contextualHelp", () => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f, (v) => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = v);
|
|
33
54
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--hasContextualHelp", () => $eb2fc0ee655eff6b$export$9ba23707a252cdd4, (v) => $eb2fc0ee655eff6b$export$9ba23707a252cdd4 = v);
|
|
34
55
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form", () => $eb2fc0ee655eff6b$export$94d2bcc94afabd89, (v) => $eb2fc0ee655eff6b$export$94d2bcc94afabd89 = v);
|
|
35
56
|
$parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form--positionSide", () => $eb2fc0ee655eff6b$export$7f44db659563c8f4, (v) => $eb2fc0ee655eff6b$export$7f44db659563c8f4 = v);
|
|
@@ -44,12 +65,12 @@ var $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e;
|
|
|
44
65
|
var $eb2fc0ee655eff6b$export$7c47642c7d46f3c9;
|
|
45
66
|
var $eb2fc0ee655eff6b$export$885efcc08143a987;
|
|
46
67
|
var $eb2fc0ee655eff6b$export$f6d480ae1e56eba0;
|
|
68
|
+
var $eb2fc0ee655eff6b$export$24fb860d16dd2d3f;
|
|
47
69
|
var $eb2fc0ee655eff6b$export$a4ea780a9064d7f9;
|
|
48
70
|
var $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d;
|
|
49
71
|
var $eb2fc0ee655eff6b$export$5354c9be7ada5f83;
|
|
50
72
|
var $eb2fc0ee655eff6b$export$2963225c91179589;
|
|
51
73
|
var $eb2fc0ee655eff6b$export$127df0b7290eb8ef;
|
|
52
|
-
var $eb2fc0ee655eff6b$export$24fb860d16dd2d3f;
|
|
53
74
|
var $eb2fc0ee655eff6b$export$9ba23707a252cdd4;
|
|
54
75
|
var $eb2fc0ee655eff6b$export$94d2bcc94afabd89;
|
|
55
76
|
var $eb2fc0ee655eff6b$export$7f44db659563c8f4;
|
|
@@ -64,12 +85,12 @@ $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e = "spectrum-FieldLabel--positionSide_d
|
|
|
64
85
|
$eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = "spectrum-FieldLabel-requiredIcon_d2db1f";
|
|
65
86
|
$eb2fc0ee655eff6b$export$885efcc08143a987 = "spectrum-FieldLabel--alignEnd_d2db1f";
|
|
66
87
|
$eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = "spectrum-Field_d2db1f";
|
|
88
|
+
$eb2fc0ee655eff6b$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
|
67
89
|
$eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = "spectrum-Field--positionTop_d2db1f";
|
|
68
90
|
$eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = "spectrum-Field-field_d2db1f";
|
|
69
91
|
$eb2fc0ee655eff6b$export$5354c9be7ada5f83 = "spectrum-Field--alignEnd_d2db1f";
|
|
70
92
|
$eb2fc0ee655eff6b$export$2963225c91179589 = "spectrum-Field--positionSide_d2db1f";
|
|
71
93
|
$eb2fc0ee655eff6b$export$127df0b7290eb8ef = "spectrum-Field-wrapper_d2db1f";
|
|
72
|
-
$eb2fc0ee655eff6b$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
|
73
94
|
$eb2fc0ee655eff6b$export$9ba23707a252cdd4 = "spectrum-Field--hasContextualHelp_d2db1f";
|
|
74
95
|
$eb2fc0ee655eff6b$export$94d2bcc94afabd89 = "spectrum-Form_d2db1f";
|
|
75
96
|
$eb2fc0ee655eff6b$export$7f44db659563c8f4 = "spectrum-Form--positionSide_d2db1f";
|
|
@@ -81,9 +102,9 @@ $eb2fc0ee655eff6b$export$51ec27881a1e3928 = "spectrum-Form-itemLabel_d2db1f";
|
|
|
81
102
|
$eb2fc0ee655eff6b$export$d35bc1e505d1ebbf = "is-disabled_d2db1f";
|
|
82
103
|
|
|
83
104
|
|
|
84
|
-
let $d981bcab8e24f2f3$var$FormContext = /*#__PURE__*/ ($parcel$interopDefault($eLNG1$react)).createContext(null);
|
|
105
|
+
let $d981bcab8e24f2f3$var$FormContext = /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createContext(null);
|
|
85
106
|
function $d981bcab8e24f2f3$export$a6b5be5c6b451665(props) {
|
|
86
|
-
let ctx = $eLNG1$react.useContext($d981bcab8e24f2f3$var$FormContext);
|
|
107
|
+
let ctx = (0, $eLNG1$react.useContext)($d981bcab8e24f2f3$var$FormContext);
|
|
87
108
|
if (ctx) return {
|
|
88
109
|
...ctx,
|
|
89
110
|
...props
|
|
@@ -91,49 +112,49 @@ function $d981bcab8e24f2f3$export$a6b5be5c6b451665(props) {
|
|
|
91
112
|
return props;
|
|
92
113
|
}
|
|
93
114
|
const $d981bcab8e24f2f3$var$formPropNames = new Set([
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
115
|
+
"action",
|
|
116
|
+
"autoComplete",
|
|
117
|
+
"encType",
|
|
118
|
+
"method",
|
|
119
|
+
"target",
|
|
120
|
+
"onSubmit"
|
|
100
121
|
]);
|
|
101
122
|
function $d981bcab8e24f2f3$var$Form(props, ref) {
|
|
102
|
-
props = $eLNG1$reactspectrumprovider.useProviderProps(props);
|
|
103
|
-
let { children: children , labelPosition: labelPosition =
|
|
104
|
-
let { styleProps: styleProps } = $eLNG1$reactspectrumutils.useStyleProps(otherProps);
|
|
105
|
-
let domRef = $eLNG1$reactspectrumutils.useDOMRef(ref);
|
|
123
|
+
props = (0, $eLNG1$reactspectrumprovider.useProviderProps)(props);
|
|
124
|
+
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;
|
|
125
|
+
let { styleProps: styleProps } = (0, $eLNG1$reactspectrumutils.useStyleProps)(otherProps);
|
|
126
|
+
let domRef = (0, $eLNG1$reactspectrumutils.useDOMRef)(ref);
|
|
106
127
|
let ctx = {
|
|
107
128
|
labelPosition: labelPosition,
|
|
108
129
|
labelAlign: labelAlign,
|
|
109
130
|
necessityIndicator: necessityIndicator
|
|
110
131
|
};
|
|
111
|
-
return
|
|
112
|
-
|
|
132
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement("form", {
|
|
133
|
+
...(0, $eLNG1$reactariautils.filterDOMProps)(otherProps, {
|
|
113
134
|
labelable: true,
|
|
114
135
|
propNames: $d981bcab8e24f2f3$var$formPropNames
|
|
115
136
|
}),
|
|
116
137
|
...styleProps,
|
|
117
138
|
noValidate: true,
|
|
118
139
|
ref: domRef,
|
|
119
|
-
className: $eLNG1$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($eb2fc0ee655eff6b$exports)),
|
|
120
|
-
|
|
121
|
-
|
|
140
|
+
className: (0, $eLNG1$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($eb2fc0ee655eff6b$exports))), "spectrum-Form", {
|
|
141
|
+
"spectrum-Form--positionSide": labelPosition === "side",
|
|
142
|
+
"spectrum-Form--positionTop": labelPosition === "top"
|
|
122
143
|
}, styleProps.className)
|
|
123
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLNG1$react)).createElement($d981bcab8e24f2f3$var$FormContext.Provider, {
|
|
144
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement($d981bcab8e24f2f3$var$FormContext.Provider, {
|
|
124
145
|
value: ctx
|
|
125
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLNG1$react)).createElement($eLNG1$reactspectrumprovider.Provider, {
|
|
146
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement((0, $eLNG1$reactspectrumprovider.Provider), {
|
|
126
147
|
isQuiet: isQuiet,
|
|
127
148
|
isEmphasized: isEmphasized,
|
|
128
149
|
isDisabled: isDisabled,
|
|
129
150
|
isReadOnly: isReadOnly,
|
|
130
151
|
isRequired: isRequired,
|
|
131
152
|
validationState: validationState
|
|
132
|
-
}, children)))
|
|
153
|
+
}, children)));
|
|
133
154
|
}
|
|
134
155
|
/**
|
|
135
156
|
* Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
|
|
136
|
-
*/ const $d981bcab8e24f2f3$export$a7fed597f4b8afd8 = /*#__PURE__*/ ($parcel$interopDefault($eLNG1$react)).forwardRef($d981bcab8e24f2f3$var$Form);
|
|
157
|
+
*/ const $d981bcab8e24f2f3$export$a7fed597f4b8afd8 = /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).forwardRef($d981bcab8e24f2f3$var$Form);
|
|
137
158
|
|
|
138
159
|
|
|
139
160
|
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAnBA,2CAAwC;AACxC,4CAAsD;AACtD,4CAAqD;AACrD,4CAAkD;AAClD,4CAAmC;AACnC,4CAAkD;AAClD,4CAAgD;AAChD,2CAAyC;AACzC,4CAA6C;AAC7C,4CAAiD;AACjD,4CAA2C;AAC3C,4CAAsD;AACtD,4CAAkC;AAClC,4CAAgD;AAChD,4CAA6C;AAC7C,4CAAgD;AAChD,4CAA+C;AAC/C,4CAA0C;AAC1C,4CAA4C;AAC5C,4CAAgC;;;ADChC,IAAI,kDAAc,CAAA,GAAA,sCAAK,AAAD,EAAE,aAAa,CAAyB,IAAI;AAC3D,SAAS,0CAA+C,KAAQ,EAAK;IAC1E,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IACrB,IAAI,KACF,OAAO;QAAC,GAAG,GAAG;QAAE,GAAG,KAAK;IAAA;IAG1B,OAAO;AACT;AAEA,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;CACD;AAED,SAAS,2BAAK,KAAwB,EAAE,GAA4B,EAAE;IACpE,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,YACF,SAAQ,iBACR,gBAAgB,oBAChB,aAAa,sBACb,WAAU,sBACV,mBAAkB,WAClB,QAAO,gBACP,aAAY,cACZ,WAAU,cACV,WAAU,mBACV,gBAAe,EACf,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,WAAU,EAAC,GAAG,CAAA,GAAA,uCAAa,AAAD,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,MAAM;uBACR;oBACA;4BACA;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAc,AAAD,EAAE,YAAY;YAAC,WAAW,IAAI;YAAE,WAAW;QAAa,EAAE;QAC1E,GAAG,UAAU;QACd,YAAA,IAAU;QACV,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,yDAAM,OAAD,GACL,iBACA;YACE,+BAA+B,kBAAkB;YACjD,8BAA8B,kBAAkB;QAClD,GACA,WAAW,SAAS;qBAGxB,0DAAC,kCAAY,QAAQ;QAAC,OAAO;qBAC3B,0DAAC,CAAA,GAAA,qCAAO;QACN,SAAS;QACT,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,iBAAiB;OAChB;AAKX;AAEA;;CAEC,GACD,MAAM,0DAAQ,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;;ADrF/B","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"}
|
package/dist/module.js
CHANGED
|
@@ -10,7 +10,28 @@ function $parcel$interopDefault(a) {
|
|
|
10
10
|
function $parcel$export(e, n, v, s) {
|
|
11
11
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
/*
|
|
14
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
15
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
17
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
20
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
21
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
|
+
* governing permissions and limitations under the License.
|
|
23
|
+
*/ /// <reference types="css-module-types" />
|
|
24
|
+
/*
|
|
25
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
26
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
27
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
28
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
29
|
+
*
|
|
30
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
31
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
32
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
33
|
+
* governing permissions and limitations under the License.
|
|
34
|
+
*/
|
|
14
35
|
|
|
15
36
|
|
|
16
37
|
|
|
@@ -21,12 +42,12 @@ $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--positionSide", (
|
|
|
21
42
|
$parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel-requiredIcon", () => $cd231e464c886c86$export$7c47642c7d46f3c9, (v) => $cd231e464c886c86$export$7c47642c7d46f3c9 = v);
|
|
22
43
|
$parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--alignEnd", () => $cd231e464c886c86$export$885efcc08143a987, (v) => $cd231e464c886c86$export$885efcc08143a987 = v);
|
|
23
44
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field", () => $cd231e464c886c86$export$f6d480ae1e56eba0, (v) => $cd231e464c886c86$export$f6d480ae1e56eba0 = v);
|
|
45
|
+
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
|
|
24
46
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionTop", () => $cd231e464c886c86$export$a4ea780a9064d7f9, (v) => $cd231e464c886c86$export$a4ea780a9064d7f9 = v);
|
|
25
47
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-field", () => $cd231e464c886c86$export$3ab8a3dc7f0563d, (v) => $cd231e464c886c86$export$3ab8a3dc7f0563d = v);
|
|
26
48
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--alignEnd", () => $cd231e464c886c86$export$5354c9be7ada5f83, (v) => $cd231e464c886c86$export$5354c9be7ada5f83 = v);
|
|
27
49
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionSide", () => $cd231e464c886c86$export$2963225c91179589, (v) => $cd231e464c886c86$export$2963225c91179589 = v);
|
|
28
50
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-wrapper", () => $cd231e464c886c86$export$127df0b7290eb8ef, (v) => $cd231e464c886c86$export$127df0b7290eb8ef = v);
|
|
29
|
-
$parcel$export($cd231e464c886c86$exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
|
|
30
51
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Field--hasContextualHelp", () => $cd231e464c886c86$export$9ba23707a252cdd4, (v) => $cd231e464c886c86$export$9ba23707a252cdd4 = v);
|
|
31
52
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Form", () => $cd231e464c886c86$export$94d2bcc94afabd89, (v) => $cd231e464c886c86$export$94d2bcc94afabd89 = v);
|
|
32
53
|
$parcel$export($cd231e464c886c86$exports, "spectrum-Form--positionSide", () => $cd231e464c886c86$export$7f44db659563c8f4, (v) => $cd231e464c886c86$export$7f44db659563c8f4 = v);
|
|
@@ -41,12 +62,12 @@ var $cd231e464c886c86$export$9e6f19dc21f22f2e;
|
|
|
41
62
|
var $cd231e464c886c86$export$7c47642c7d46f3c9;
|
|
42
63
|
var $cd231e464c886c86$export$885efcc08143a987;
|
|
43
64
|
var $cd231e464c886c86$export$f6d480ae1e56eba0;
|
|
65
|
+
var $cd231e464c886c86$export$24fb860d16dd2d3f;
|
|
44
66
|
var $cd231e464c886c86$export$a4ea780a9064d7f9;
|
|
45
67
|
var $cd231e464c886c86$export$3ab8a3dc7f0563d;
|
|
46
68
|
var $cd231e464c886c86$export$5354c9be7ada5f83;
|
|
47
69
|
var $cd231e464c886c86$export$2963225c91179589;
|
|
48
70
|
var $cd231e464c886c86$export$127df0b7290eb8ef;
|
|
49
|
-
var $cd231e464c886c86$export$24fb860d16dd2d3f;
|
|
50
71
|
var $cd231e464c886c86$export$9ba23707a252cdd4;
|
|
51
72
|
var $cd231e464c886c86$export$94d2bcc94afabd89;
|
|
52
73
|
var $cd231e464c886c86$export$7f44db659563c8f4;
|
|
@@ -61,12 +82,12 @@ $cd231e464c886c86$export$9e6f19dc21f22f2e = "spectrum-FieldLabel--positionSide_d
|
|
|
61
82
|
$cd231e464c886c86$export$7c47642c7d46f3c9 = "spectrum-FieldLabel-requiredIcon_d2db1f";
|
|
62
83
|
$cd231e464c886c86$export$885efcc08143a987 = "spectrum-FieldLabel--alignEnd_d2db1f";
|
|
63
84
|
$cd231e464c886c86$export$f6d480ae1e56eba0 = "spectrum-Field_d2db1f";
|
|
85
|
+
$cd231e464c886c86$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
|
64
86
|
$cd231e464c886c86$export$a4ea780a9064d7f9 = "spectrum-Field--positionTop_d2db1f";
|
|
65
87
|
$cd231e464c886c86$export$3ab8a3dc7f0563d = "spectrum-Field-field_d2db1f";
|
|
66
88
|
$cd231e464c886c86$export$5354c9be7ada5f83 = "spectrum-Field--alignEnd_d2db1f";
|
|
67
89
|
$cd231e464c886c86$export$2963225c91179589 = "spectrum-Field--positionSide_d2db1f";
|
|
68
90
|
$cd231e464c886c86$export$127df0b7290eb8ef = "spectrum-Field-wrapper_d2db1f";
|
|
69
|
-
$cd231e464c886c86$export$24fb860d16dd2d3f = "spectrum-Field-contextualHelp_d2db1f";
|
|
70
91
|
$cd231e464c886c86$export$9ba23707a252cdd4 = "spectrum-Field--hasContextualHelp_d2db1f";
|
|
71
92
|
$cd231e464c886c86$export$94d2bcc94afabd89 = "spectrum-Form_d2db1f";
|
|
72
93
|
$cd231e464c886c86$export$7f44db659563c8f4 = "spectrum-Form--positionSide_d2db1f";
|
|
@@ -78,9 +99,9 @@ $cd231e464c886c86$export$51ec27881a1e3928 = "spectrum-Form-itemLabel_d2db1f";
|
|
|
78
99
|
$cd231e464c886c86$export$d35bc1e505d1ebbf = "is-disabled_d2db1f";
|
|
79
100
|
|
|
80
101
|
|
|
81
|
-
let $ac118ceca79b8650$var$FormContext = /*#__PURE__*/ $011V3$react.createContext(null);
|
|
102
|
+
let $ac118ceca79b8650$var$FormContext = /*#__PURE__*/ (0, $011V3$react).createContext(null);
|
|
82
103
|
function $ac118ceca79b8650$export$a6b5be5c6b451665(props) {
|
|
83
|
-
let ctx = $011V3$useContext($ac118ceca79b8650$var$FormContext);
|
|
104
|
+
let ctx = (0, $011V3$useContext)($ac118ceca79b8650$var$FormContext);
|
|
84
105
|
if (ctx) return {
|
|
85
106
|
...ctx,
|
|
86
107
|
...props
|
|
@@ -88,49 +109,49 @@ function $ac118ceca79b8650$export$a6b5be5c6b451665(props) {
|
|
|
88
109
|
return props;
|
|
89
110
|
}
|
|
90
111
|
const $ac118ceca79b8650$var$formPropNames = new Set([
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
112
|
+
"action",
|
|
113
|
+
"autoComplete",
|
|
114
|
+
"encType",
|
|
115
|
+
"method",
|
|
116
|
+
"target",
|
|
117
|
+
"onSubmit"
|
|
97
118
|
]);
|
|
98
119
|
function $ac118ceca79b8650$var$Form(props, ref) {
|
|
99
|
-
props = $011V3$useProviderProps(props);
|
|
100
|
-
let { children: children , labelPosition: labelPosition =
|
|
101
|
-
let { styleProps: styleProps } = $011V3$useStyleProps(otherProps);
|
|
102
|
-
let domRef = $011V3$useDOMRef(ref);
|
|
120
|
+
props = (0, $011V3$useProviderProps)(props);
|
|
121
|
+
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;
|
|
122
|
+
let { styleProps: styleProps } = (0, $011V3$useStyleProps)(otherProps);
|
|
123
|
+
let domRef = (0, $011V3$useDOMRef)(ref);
|
|
103
124
|
let ctx = {
|
|
104
125
|
labelPosition: labelPosition,
|
|
105
126
|
labelAlign: labelAlign,
|
|
106
127
|
necessityIndicator: necessityIndicator
|
|
107
128
|
};
|
|
108
|
-
return
|
|
109
|
-
|
|
129
|
+
return /*#__PURE__*/ (0, $011V3$react).createElement("form", {
|
|
130
|
+
...(0, $011V3$filterDOMProps)(otherProps, {
|
|
110
131
|
labelable: true,
|
|
111
132
|
propNames: $ac118ceca79b8650$var$formPropNames
|
|
112
133
|
}),
|
|
113
134
|
...styleProps,
|
|
114
135
|
noValidate: true,
|
|
115
136
|
ref: domRef,
|
|
116
|
-
className: $011V3$classNames((/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports)),
|
|
117
|
-
|
|
118
|
-
|
|
137
|
+
className: (0, $011V3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports))), "spectrum-Form", {
|
|
138
|
+
"spectrum-Form--positionSide": labelPosition === "side",
|
|
139
|
+
"spectrum-Form--positionTop": labelPosition === "top"
|
|
119
140
|
}, styleProps.className)
|
|
120
|
-
}, /*#__PURE__*/ $011V3$react.createElement($ac118ceca79b8650$var$FormContext.Provider, {
|
|
141
|
+
}, /*#__PURE__*/ (0, $011V3$react).createElement($ac118ceca79b8650$var$FormContext.Provider, {
|
|
121
142
|
value: ctx
|
|
122
|
-
}, /*#__PURE__*/ $011V3$react.createElement($011V3$Provider, {
|
|
143
|
+
}, /*#__PURE__*/ (0, $011V3$react).createElement((0, $011V3$Provider), {
|
|
123
144
|
isQuiet: isQuiet,
|
|
124
145
|
isEmphasized: isEmphasized,
|
|
125
146
|
isDisabled: isDisabled,
|
|
126
147
|
isReadOnly: isReadOnly,
|
|
127
148
|
isRequired: isRequired,
|
|
128
149
|
validationState: validationState
|
|
129
|
-
}, children)))
|
|
150
|
+
}, children)));
|
|
130
151
|
}
|
|
131
152
|
/**
|
|
132
153
|
* Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
|
|
133
|
-
*/ const $ac118ceca79b8650$export$a7fed597f4b8afd8 = /*#__PURE__*/ $011V3$react.forwardRef($ac118ceca79b8650$var$Form);
|
|
154
|
+
*/ const $ac118ceca79b8650$export$a7fed597f4b8afd8 = /*#__PURE__*/ (0, $011V3$react).forwardRef($ac118ceca79b8650$var$Form);
|
|
134
155
|
|
|
135
156
|
|
|
136
157
|
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;ACZA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAnBA,2CAAwC;AACxC,4CAAsD;AACtD,4CAAqD;AACrD,4CAAkD;AAClD,4CAAmC;AACnC,4CAAkD;AAClD,4CAAgD;AAChD,2CAAyC;AACzC,4CAA6C;AAC7C,4CAAiD;AACjD,4CAA2C;AAC3C,4CAAsD;AACtD,4CAAkC;AAClC,4CAAgD;AAChD,4CAA6C;AAC7C,4CAAgD;AAChD,4CAA+C;AAC/C,4CAA0C;AAC1C,4CAA4C;AAC5C,4CAAgC;;;ADChC,IAAI,kDAAc,CAAA,GAAA,YAAK,AAAD,EAAE,aAAa,CAAyB,IAAI;AAC3D,SAAS,0CAA+C,KAAQ,EAAK;IAC1E,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IACrB,IAAI,KACF,OAAO;QAAC,GAAG,GAAG;QAAE,GAAG,KAAK;IAAA;IAG1B,OAAO;AACT;AAEA,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;CACD;AAED,SAAS,2BAAK,KAAwB,EAAE,GAA4B,EAAE;IACpE,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,YACF,SAAQ,iBACR,gBAAgB,oBAChB,aAAa,sBACb,WAAU,sBACV,mBAAkB,WAClB,QAAO,gBACP,aAAY,cACZ,WAAU,cACV,WAAU,mBACV,gBAAe,EACf,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,WAAU,EAAC,GAAG,CAAA,GAAA,oBAAa,AAAD,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,MAAM;uBACR;oBACA;4BACA;IACF;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAc,AAAD,EAAE,YAAY;YAAC,WAAW,IAAI;YAAE,WAAW;QAAa,EAAE;QAC1E,GAAG,UAAU;QACd,YAAA,IAAU;QACV,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,yDAAM,OAAD,GACL,iBACA;YACE,+BAA+B,kBAAkB;YACjD,8BAA8B,kBAAkB;QAClD,GACA,WAAW,SAAS;qBAGxB,gCAAC,kCAAY,QAAQ;QAAC,OAAO;qBAC3B,gCAAC,CAAA,GAAA,eAAO;QACN,SAAS;QACT,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,iBAAiB;OAChB;AAKX;AAEA;;CAEC,GACD,MAAM,0DAAQ,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;;ADrF/B","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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/form",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"url": "https://github.com/adobe/react-spectrum"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@react-
|
|
36
|
-
"@react-
|
|
37
|
-
"@react-types/
|
|
38
|
-
"@
|
|
34
|
+
"@react-aria/utils": "^3.14.2",
|
|
35
|
+
"@react-spectrum/utils": "^3.8.1",
|
|
36
|
+
"@react-types/form": "^3.4.1",
|
|
37
|
+
"@react-types/shared": "^3.16.0",
|
|
38
|
+
"@swc/helpers": "^0.4.14"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
|
|
51
51
|
}
|