@react-spectrum/form 3.7.4 → 3.7.6

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,18 +1,5 @@
1
- import "./main.css";
2
- import {useStyleProps as $011V3$useStyleProps, useDOMRef as $011V3$useDOMRef, classNames as $011V3$classNames} from "@react-spectrum/utils";
3
- import {filterDOMProps as $011V3$filterDOMProps} from "@react-aria/utils";
4
- import {FormValidationContext as $011V3$FormValidationContext} from "@react-stately/form";
5
- import {useProviderProps as $011V3$useProviderProps, Provider as $011V3$Provider} from "@react-spectrum/provider";
6
- import $011V3$react, {useContext as $011V3$useContext} from "react";
1
+ import {Form as $ac118ceca79b8650$export$a7fed597f4b8afd8, useFormProps as $ac118ceca79b8650$export$a6b5be5c6b451665} from "./Form.mjs";
7
2
 
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
-
13
- function $parcel$export(e, n, v, s) {
14
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
- }
16
3
  /*
17
4
  * Copyright 2020 Adobe. All rights reserved.
18
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -24,171 +11,6 @@ function $parcel$export(e, n, v, s) {
24
11
  * OF ANY KIND, either express or implied. See the License for the specific language
25
12
  * governing permissions and limitations under the License.
26
13
  */ /// <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
- */
38
-
39
-
40
-
41
-
42
- var $cd231e464c886c86$exports = {};
43
-
44
- $parcel$export($cd231e464c886c86$exports, "contextualHelp", () => $cd231e464c886c86$export$4ba534aba1836d, (v) => $cd231e464c886c86$export$4ba534aba1836d = v);
45
- $parcel$export($cd231e464c886c86$exports, "field", () => $cd231e464c886c86$export$e0f35d825088c098, (v) => $cd231e464c886c86$export$e0f35d825088c098 = v);
46
- $parcel$export($cd231e464c886c86$exports, "focus-ring", () => $cd231e464c886c86$export$f39a09f249340e2a, (v) => $cd231e464c886c86$export$f39a09f249340e2a = v);
47
- $parcel$export($cd231e464c886c86$exports, "helpText", () => $cd231e464c886c86$export$431a3b688422af44, (v) => $cd231e464c886c86$export$431a3b688422af44 = v);
48
- $parcel$export($cd231e464c886c86$exports, "i18nFontFamily", () => $cd231e464c886c86$export$8c4ee2c50c22c514, (v) => $cd231e464c886c86$export$8c4ee2c50c22c514 = v);
49
- $parcel$export($cd231e464c886c86$exports, "is-disabled", () => $cd231e464c886c86$export$d35bc1e505d1ebbf, (v) => $cd231e464c886c86$export$d35bc1e505d1ebbf = v);
50
- $parcel$export($cd231e464c886c86$exports, "label", () => $cd231e464c886c86$export$1237798dc640739a, (v) => $cd231e464c886c86$export$1237798dc640739a = v);
51
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field", () => $cd231e464c886c86$export$f6d480ae1e56eba0, (v) => $cd231e464c886c86$export$f6d480ae1e56eba0 = v);
52
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--alignEnd", () => $cd231e464c886c86$export$5354c9be7ada5f83, (v) => $cd231e464c886c86$export$5354c9be7ada5f83 = v);
53
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--hasContextualHelp", () => $cd231e464c886c86$export$9ba23707a252cdd4, (v) => $cd231e464c886c86$export$9ba23707a252cdd4 = v);
54
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionSide", () => $cd231e464c886c86$export$2963225c91179589, (v) => $cd231e464c886c86$export$2963225c91179589 = v);
55
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionTop", () => $cd231e464c886c86$export$a4ea780a9064d7f9, (v) => $cd231e464c886c86$export$a4ea780a9064d7f9 = v);
56
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
57
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-field", () => $cd231e464c886c86$export$3ab8a3dc7f0563d, (v) => $cd231e464c886c86$export$3ab8a3dc7f0563d = v);
58
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-labelCell", () => $cd231e464c886c86$export$9cde5aecff012641, (v) => $cd231e464c886c86$export$9cde5aecff012641 = v);
59
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-labelWrapper", () => $cd231e464c886c86$export$a872a8c78b26c9e0, (v) => $cd231e464c886c86$export$a872a8c78b26c9e0 = v);
60
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-wrapper", () => $cd231e464c886c86$export$127df0b7290eb8ef, (v) => $cd231e464c886c86$export$127df0b7290eb8ef = v);
61
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel", () => $cd231e464c886c86$export$493d18e796ae054, (v) => $cd231e464c886c86$export$493d18e796ae054 = v);
62
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--alignEnd", () => $cd231e464c886c86$export$885efcc08143a987, (v) => $cd231e464c886c86$export$885efcc08143a987 = v);
63
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--positionSide", () => $cd231e464c886c86$export$9e6f19dc21f22f2e, (v) => $cd231e464c886c86$export$9e6f19dc21f22f2e = v);
64
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel-requiredIcon", () => $cd231e464c886c86$export$7c47642c7d46f3c9, (v) => $cd231e464c886c86$export$7c47642c7d46f3c9 = v);
65
- $parcel$export($cd231e464c886c86$exports, "spectrum-FocusRing-ring", () => $cd231e464c886c86$export$4109102f950813a6, (v) => $cd231e464c886c86$export$4109102f950813a6 = v);
66
- $parcel$export($cd231e464c886c86$exports, "spectrum-FocusRing", () => $cd231e464c886c86$export$24c7f46a6e3605dd, (v) => $cd231e464c886c86$export$24c7f46a6e3605dd = v);
67
- $parcel$export($cd231e464c886c86$exports, "spectrum-FocusRing--quiet", () => $cd231e464c886c86$export$2927016961429360, (v) => $cd231e464c886c86$export$2927016961429360 = v);
68
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form", () => $cd231e464c886c86$export$94d2bcc94afabd89, (v) => $cd231e464c886c86$export$94d2bcc94afabd89 = v);
69
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form--positionSide", () => $cd231e464c886c86$export$7f44db659563c8f4, (v) => $cd231e464c886c86$export$7f44db659563c8f4 = v);
70
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form--positionTop", () => $cd231e464c886c86$export$11b8bc81fe551057, (v) => $cd231e464c886c86$export$11b8bc81fe551057 = v);
71
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form-itemLabel", () => $cd231e464c886c86$export$51ec27881a1e3928, (v) => $cd231e464c886c86$export$51ec27881a1e3928 = v);
72
- $parcel$export($cd231e464c886c86$exports, "spectrum-LabeledValue", () => $cd231e464c886c86$export$79f9a5e9dd010c8d, (v) => $cd231e464c886c86$export$79f9a5e9dd010c8d = v);
73
- var $cd231e464c886c86$export$4ba534aba1836d;
74
- var $cd231e464c886c86$export$e0f35d825088c098;
75
- var $cd231e464c886c86$export$f39a09f249340e2a;
76
- var $cd231e464c886c86$export$431a3b688422af44;
77
- var $cd231e464c886c86$export$8c4ee2c50c22c514;
78
- var $cd231e464c886c86$export$d35bc1e505d1ebbf;
79
- var $cd231e464c886c86$export$1237798dc640739a;
80
- var $cd231e464c886c86$export$f6d480ae1e56eba0;
81
- var $cd231e464c886c86$export$5354c9be7ada5f83;
82
- var $cd231e464c886c86$export$9ba23707a252cdd4;
83
- var $cd231e464c886c86$export$2963225c91179589;
84
- var $cd231e464c886c86$export$a4ea780a9064d7f9;
85
- var $cd231e464c886c86$export$24fb860d16dd2d3f;
86
- var $cd231e464c886c86$export$3ab8a3dc7f0563d;
87
- var $cd231e464c886c86$export$9cde5aecff012641;
88
- var $cd231e464c886c86$export$a872a8c78b26c9e0;
89
- var $cd231e464c886c86$export$127df0b7290eb8ef;
90
- var $cd231e464c886c86$export$493d18e796ae054;
91
- var $cd231e464c886c86$export$885efcc08143a987;
92
- var $cd231e464c886c86$export$9e6f19dc21f22f2e;
93
- var $cd231e464c886c86$export$7c47642c7d46f3c9;
94
- var $cd231e464c886c86$export$4109102f950813a6;
95
- var $cd231e464c886c86$export$24c7f46a6e3605dd;
96
- var $cd231e464c886c86$export$2927016961429360;
97
- var $cd231e464c886c86$export$94d2bcc94afabd89;
98
- var $cd231e464c886c86$export$7f44db659563c8f4;
99
- var $cd231e464c886c86$export$11b8bc81fe551057;
100
- var $cd231e464c886c86$export$51ec27881a1e3928;
101
- var $cd231e464c886c86$export$79f9a5e9dd010c8d;
102
- $cd231e464c886c86$export$4ba534aba1836d = `A-HlBa_contextualHelp`;
103
- $cd231e464c886c86$export$e0f35d825088c098 = `A-HlBa_field`;
104
- $cd231e464c886c86$export$f39a09f249340e2a = `A-HlBa_focus-ring`;
105
- $cd231e464c886c86$export$431a3b688422af44 = `A-HlBa_helpText`;
106
- $cd231e464c886c86$export$8c4ee2c50c22c514 = `A-HlBa_i18nFontFamily`;
107
- $cd231e464c886c86$export$d35bc1e505d1ebbf = `A-HlBa_is-disabled`;
108
- $cd231e464c886c86$export$1237798dc640739a = `A-HlBa_label`;
109
- $cd231e464c886c86$export$f6d480ae1e56eba0 = `A-HlBa_spectrum-Field`;
110
- $cd231e464c886c86$export$5354c9be7ada5f83 = `A-HlBa_spectrum-Field--alignEnd`;
111
- $cd231e464c886c86$export$9ba23707a252cdd4 = `A-HlBa_spectrum-Field--hasContextualHelp`;
112
- $cd231e464c886c86$export$2963225c91179589 = `A-HlBa_spectrum-Field--positionSide`;
113
- $cd231e464c886c86$export$a4ea780a9064d7f9 = `A-HlBa_spectrum-Field--positionTop`;
114
- $cd231e464c886c86$export$24fb860d16dd2d3f = `A-HlBa_spectrum-Field-contextualHelp`;
115
- $cd231e464c886c86$export$3ab8a3dc7f0563d = `A-HlBa_spectrum-Field-field`;
116
- $cd231e464c886c86$export$9cde5aecff012641 = `A-HlBa_spectrum-Field-labelCell`;
117
- $cd231e464c886c86$export$a872a8c78b26c9e0 = `A-HlBa_spectrum-Field-labelWrapper`;
118
- $cd231e464c886c86$export$127df0b7290eb8ef = `A-HlBa_spectrum-Field-wrapper`;
119
- $cd231e464c886c86$export$493d18e796ae054 = `A-HlBa_spectrum-FieldLabel`;
120
- $cd231e464c886c86$export$885efcc08143a987 = `A-HlBa_spectrum-FieldLabel--alignEnd`;
121
- $cd231e464c886c86$export$9e6f19dc21f22f2e = `A-HlBa_spectrum-FieldLabel--positionSide`;
122
- $cd231e464c886c86$export$7c47642c7d46f3c9 = `A-HlBa_spectrum-FieldLabel-requiredIcon`;
123
- $cd231e464c886c86$export$4109102f950813a6 = `A-HlBa_spectrum-FocusRing-ring`;
124
- $cd231e464c886c86$export$24c7f46a6e3605dd = `A-HlBa_spectrum-FocusRing ${$cd231e464c886c86$export$4109102f950813a6}`;
125
- $cd231e464c886c86$export$2927016961429360 = `A-HlBa_spectrum-FocusRing--quiet`;
126
- $cd231e464c886c86$export$94d2bcc94afabd89 = `A-HlBa_spectrum-Form`;
127
- $cd231e464c886c86$export$7f44db659563c8f4 = `A-HlBa_spectrum-Form--positionSide`;
128
- $cd231e464c886c86$export$11b8bc81fe551057 = `A-HlBa_spectrum-Form--positionTop`;
129
- $cd231e464c886c86$export$51ec27881a1e3928 = `A-HlBa_spectrum-Form-itemLabel`;
130
- $cd231e464c886c86$export$79f9a5e9dd010c8d = `A-HlBa_spectrum-LabeledValue`;
131
-
132
-
133
- let $ac118ceca79b8650$var$FormContext = /*#__PURE__*/ (0, $011V3$react).createContext(null);
134
- function $ac118ceca79b8650$export$a6b5be5c6b451665(props) {
135
- let ctx = (0, $011V3$useContext)($ac118ceca79b8650$var$FormContext);
136
- if (ctx) return {
137
- ...ctx,
138
- ...props
139
- };
140
- return props;
141
- }
142
- const $ac118ceca79b8650$var$formPropNames = new Set([
143
- "action",
144
- "autoComplete",
145
- "encType",
146
- "method",
147
- "target",
148
- "onSubmit",
149
- "onReset",
150
- "onInvalid"
151
- ]);
152
- function $ac118ceca79b8650$var$Form(props, ref) {
153
- props = (0, $011V3$useProviderProps)(props);
154
- 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;
155
- let { styleProps: styleProps } = (0, $011V3$useStyleProps)(otherProps);
156
- let domRef = (0, $011V3$useDOMRef)(ref);
157
- let ctx = {
158
- labelPosition: labelPosition,
159
- labelAlign: labelAlign,
160
- necessityIndicator: necessityIndicator,
161
- validationBehavior: validationBehavior
162
- };
163
- return /*#__PURE__*/ (0, $011V3$react).createElement("form", {
164
- ...(0, $011V3$filterDOMProps)(otherProps, {
165
- labelable: true,
166
- propNames: $ac118ceca79b8650$var$formPropNames
167
- }),
168
- ...styleProps,
169
- noValidate: validationBehavior !== "native",
170
- ref: domRef,
171
- className: (0, $011V3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports))), "spectrum-Form", {
172
- "spectrum-Form--positionSide": labelPosition === "side",
173
- "spectrum-Form--positionTop": labelPosition === "top"
174
- }, styleProps.className)
175
- }, /*#__PURE__*/ (0, $011V3$react).createElement($ac118ceca79b8650$var$FormContext.Provider, {
176
- value: ctx
177
- }, /*#__PURE__*/ (0, $011V3$react).createElement((0, $011V3$Provider), {
178
- isQuiet: isQuiet,
179
- isEmphasized: isEmphasized,
180
- isDisabled: isDisabled,
181
- isReadOnly: isReadOnly,
182
- isRequired: isRequired,
183
- validationState: validationState
184
- }, /*#__PURE__*/ (0, $011V3$react).createElement((0, $011V3$FormValidationContext).Provider, {
185
- value: validationErrors || {}
186
- }, children))));
187
- }
188
- /**
189
- * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
190
- */ const $ac118ceca79b8650$export$a7fed597f4b8afd8 = /*#__PURE__*/ (0, $011V3$react).forwardRef($ac118ceca79b8650$var$Form);
191
-
192
14
 
193
15
 
194
16
 
package/dist/main.js CHANGED
@@ -1,21 +1,12 @@
1
- require("./main.css");
2
- var $eLNG1$reactspectrumutils = require("@react-spectrum/utils");
3
- var $eLNG1$reactariautils = require("@react-aria/utils");
4
- var $eLNG1$reactstatelyform = require("@react-stately/form");
5
- var $eLNG1$reactspectrumprovider = require("@react-spectrum/provider");
6
- var $eLNG1$react = require("react");
1
+ var $d981bcab8e24f2f3$exports = require("./Form.main.js");
7
2
 
8
3
 
9
4
  function $parcel$export(e, n, v, s) {
10
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
11
6
  }
12
7
 
13
- function $parcel$interopDefault(a) {
14
- return a && a.__esModule ? a.default : a;
15
- }
16
-
17
- $parcel$export(module.exports, "useFormProps", () => $d981bcab8e24f2f3$export$a6b5be5c6b451665);
18
- $parcel$export(module.exports, "Form", () => $d981bcab8e24f2f3$export$a7fed597f4b8afd8);
8
+ $parcel$export(module.exports, "useFormProps", () => $d981bcab8e24f2f3$exports.useFormProps);
9
+ $parcel$export(module.exports, "Form", () => $d981bcab8e24f2f3$exports.Form);
19
10
  /*
20
11
  * Copyright 2020 Adobe. All rights reserved.
21
12
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -27,171 +18,6 @@ $parcel$export(module.exports, "Form", () => $d981bcab8e24f2f3$export$a7fed597f4
27
18
  * OF ANY KIND, either express or implied. See the License for the specific language
28
19
  * governing permissions and limitations under the License.
29
20
  */ /// <reference types="css-module-types" />
30
- /*
31
- * Copyright 2020 Adobe. All rights reserved.
32
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
33
- * you may not use this file except in compliance with the License. You may obtain a copy
34
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
35
- *
36
- * Unless required by applicable law or agreed to in writing, software distributed under
37
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
38
- * OF ANY KIND, either express or implied. See the License for the specific language
39
- * governing permissions and limitations under the License.
40
- */
41
-
42
-
43
-
44
-
45
- var $eb2fc0ee655eff6b$exports = {};
46
-
47
- $parcel$export($eb2fc0ee655eff6b$exports, "contextualHelp", () => $eb2fc0ee655eff6b$export$4ba534aba1836d, (v) => $eb2fc0ee655eff6b$export$4ba534aba1836d = v);
48
- $parcel$export($eb2fc0ee655eff6b$exports, "field", () => $eb2fc0ee655eff6b$export$e0f35d825088c098, (v) => $eb2fc0ee655eff6b$export$e0f35d825088c098 = v);
49
- $parcel$export($eb2fc0ee655eff6b$exports, "focus-ring", () => $eb2fc0ee655eff6b$export$f39a09f249340e2a, (v) => $eb2fc0ee655eff6b$export$f39a09f249340e2a = v);
50
- $parcel$export($eb2fc0ee655eff6b$exports, "helpText", () => $eb2fc0ee655eff6b$export$431a3b688422af44, (v) => $eb2fc0ee655eff6b$export$431a3b688422af44 = v);
51
- $parcel$export($eb2fc0ee655eff6b$exports, "i18nFontFamily", () => $eb2fc0ee655eff6b$export$8c4ee2c50c22c514, (v) => $eb2fc0ee655eff6b$export$8c4ee2c50c22c514 = v);
52
- $parcel$export($eb2fc0ee655eff6b$exports, "is-disabled", () => $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf, (v) => $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf = v);
53
- $parcel$export($eb2fc0ee655eff6b$exports, "label", () => $eb2fc0ee655eff6b$export$1237798dc640739a, (v) => $eb2fc0ee655eff6b$export$1237798dc640739a = v);
54
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field", () => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0, (v) => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = v);
55
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--alignEnd", () => $eb2fc0ee655eff6b$export$5354c9be7ada5f83, (v) => $eb2fc0ee655eff6b$export$5354c9be7ada5f83 = v);
56
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--hasContextualHelp", () => $eb2fc0ee655eff6b$export$9ba23707a252cdd4, (v) => $eb2fc0ee655eff6b$export$9ba23707a252cdd4 = v);
57
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionSide", () => $eb2fc0ee655eff6b$export$2963225c91179589, (v) => $eb2fc0ee655eff6b$export$2963225c91179589 = v);
58
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionTop", () => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9, (v) => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = v);
59
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-contextualHelp", () => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f, (v) => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = v);
60
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-field", () => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d, (v) => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = v);
61
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-labelCell", () => $eb2fc0ee655eff6b$export$9cde5aecff012641, (v) => $eb2fc0ee655eff6b$export$9cde5aecff012641 = v);
62
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-labelWrapper", () => $eb2fc0ee655eff6b$export$a872a8c78b26c9e0, (v) => $eb2fc0ee655eff6b$export$a872a8c78b26c9e0 = v);
63
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-wrapper", () => $eb2fc0ee655eff6b$export$127df0b7290eb8ef, (v) => $eb2fc0ee655eff6b$export$127df0b7290eb8ef = v);
64
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel", () => $eb2fc0ee655eff6b$export$493d18e796ae054, (v) => $eb2fc0ee655eff6b$export$493d18e796ae054 = v);
65
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--alignEnd", () => $eb2fc0ee655eff6b$export$885efcc08143a987, (v) => $eb2fc0ee655eff6b$export$885efcc08143a987 = v);
66
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--positionSide", () => $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e, (v) => $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e = v);
67
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel-requiredIcon", () => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9, (v) => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = v);
68
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FocusRing-ring", () => $eb2fc0ee655eff6b$export$4109102f950813a6, (v) => $eb2fc0ee655eff6b$export$4109102f950813a6 = v);
69
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FocusRing", () => $eb2fc0ee655eff6b$export$24c7f46a6e3605dd, (v) => $eb2fc0ee655eff6b$export$24c7f46a6e3605dd = v);
70
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FocusRing--quiet", () => $eb2fc0ee655eff6b$export$2927016961429360, (v) => $eb2fc0ee655eff6b$export$2927016961429360 = v);
71
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form", () => $eb2fc0ee655eff6b$export$94d2bcc94afabd89, (v) => $eb2fc0ee655eff6b$export$94d2bcc94afabd89 = v);
72
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form--positionSide", () => $eb2fc0ee655eff6b$export$7f44db659563c8f4, (v) => $eb2fc0ee655eff6b$export$7f44db659563c8f4 = v);
73
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form--positionTop", () => $eb2fc0ee655eff6b$export$11b8bc81fe551057, (v) => $eb2fc0ee655eff6b$export$11b8bc81fe551057 = v);
74
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form-itemLabel", () => $eb2fc0ee655eff6b$export$51ec27881a1e3928, (v) => $eb2fc0ee655eff6b$export$51ec27881a1e3928 = v);
75
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-LabeledValue", () => $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d, (v) => $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d = v);
76
- var $eb2fc0ee655eff6b$export$4ba534aba1836d;
77
- var $eb2fc0ee655eff6b$export$e0f35d825088c098;
78
- var $eb2fc0ee655eff6b$export$f39a09f249340e2a;
79
- var $eb2fc0ee655eff6b$export$431a3b688422af44;
80
- var $eb2fc0ee655eff6b$export$8c4ee2c50c22c514;
81
- var $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf;
82
- var $eb2fc0ee655eff6b$export$1237798dc640739a;
83
- var $eb2fc0ee655eff6b$export$f6d480ae1e56eba0;
84
- var $eb2fc0ee655eff6b$export$5354c9be7ada5f83;
85
- var $eb2fc0ee655eff6b$export$9ba23707a252cdd4;
86
- var $eb2fc0ee655eff6b$export$2963225c91179589;
87
- var $eb2fc0ee655eff6b$export$a4ea780a9064d7f9;
88
- var $eb2fc0ee655eff6b$export$24fb860d16dd2d3f;
89
- var $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d;
90
- var $eb2fc0ee655eff6b$export$9cde5aecff012641;
91
- var $eb2fc0ee655eff6b$export$a872a8c78b26c9e0;
92
- var $eb2fc0ee655eff6b$export$127df0b7290eb8ef;
93
- var $eb2fc0ee655eff6b$export$493d18e796ae054;
94
- var $eb2fc0ee655eff6b$export$885efcc08143a987;
95
- var $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e;
96
- var $eb2fc0ee655eff6b$export$7c47642c7d46f3c9;
97
- var $eb2fc0ee655eff6b$export$4109102f950813a6;
98
- var $eb2fc0ee655eff6b$export$24c7f46a6e3605dd;
99
- var $eb2fc0ee655eff6b$export$2927016961429360;
100
- var $eb2fc0ee655eff6b$export$94d2bcc94afabd89;
101
- var $eb2fc0ee655eff6b$export$7f44db659563c8f4;
102
- var $eb2fc0ee655eff6b$export$11b8bc81fe551057;
103
- var $eb2fc0ee655eff6b$export$51ec27881a1e3928;
104
- var $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d;
105
- $eb2fc0ee655eff6b$export$4ba534aba1836d = `A-HlBa_contextualHelp`;
106
- $eb2fc0ee655eff6b$export$e0f35d825088c098 = `A-HlBa_field`;
107
- $eb2fc0ee655eff6b$export$f39a09f249340e2a = `A-HlBa_focus-ring`;
108
- $eb2fc0ee655eff6b$export$431a3b688422af44 = `A-HlBa_helpText`;
109
- $eb2fc0ee655eff6b$export$8c4ee2c50c22c514 = `A-HlBa_i18nFontFamily`;
110
- $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf = `A-HlBa_is-disabled`;
111
- $eb2fc0ee655eff6b$export$1237798dc640739a = `A-HlBa_label`;
112
- $eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = `A-HlBa_spectrum-Field`;
113
- $eb2fc0ee655eff6b$export$5354c9be7ada5f83 = `A-HlBa_spectrum-Field--alignEnd`;
114
- $eb2fc0ee655eff6b$export$9ba23707a252cdd4 = `A-HlBa_spectrum-Field--hasContextualHelp`;
115
- $eb2fc0ee655eff6b$export$2963225c91179589 = `A-HlBa_spectrum-Field--positionSide`;
116
- $eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = `A-HlBa_spectrum-Field--positionTop`;
117
- $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = `A-HlBa_spectrum-Field-contextualHelp`;
118
- $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = `A-HlBa_spectrum-Field-field`;
119
- $eb2fc0ee655eff6b$export$9cde5aecff012641 = `A-HlBa_spectrum-Field-labelCell`;
120
- $eb2fc0ee655eff6b$export$a872a8c78b26c9e0 = `A-HlBa_spectrum-Field-labelWrapper`;
121
- $eb2fc0ee655eff6b$export$127df0b7290eb8ef = `A-HlBa_spectrum-Field-wrapper`;
122
- $eb2fc0ee655eff6b$export$493d18e796ae054 = `A-HlBa_spectrum-FieldLabel`;
123
- $eb2fc0ee655eff6b$export$885efcc08143a987 = `A-HlBa_spectrum-FieldLabel--alignEnd`;
124
- $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e = `A-HlBa_spectrum-FieldLabel--positionSide`;
125
- $eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = `A-HlBa_spectrum-FieldLabel-requiredIcon`;
126
- $eb2fc0ee655eff6b$export$4109102f950813a6 = `A-HlBa_spectrum-FocusRing-ring`;
127
- $eb2fc0ee655eff6b$export$24c7f46a6e3605dd = `A-HlBa_spectrum-FocusRing ${$eb2fc0ee655eff6b$export$4109102f950813a6}`;
128
- $eb2fc0ee655eff6b$export$2927016961429360 = `A-HlBa_spectrum-FocusRing--quiet`;
129
- $eb2fc0ee655eff6b$export$94d2bcc94afabd89 = `A-HlBa_spectrum-Form`;
130
- $eb2fc0ee655eff6b$export$7f44db659563c8f4 = `A-HlBa_spectrum-Form--positionSide`;
131
- $eb2fc0ee655eff6b$export$11b8bc81fe551057 = `A-HlBa_spectrum-Form--positionTop`;
132
- $eb2fc0ee655eff6b$export$51ec27881a1e3928 = `A-HlBa_spectrum-Form-itemLabel`;
133
- $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d = `A-HlBa_spectrum-LabeledValue`;
134
-
135
-
136
- let $d981bcab8e24f2f3$var$FormContext = /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createContext(null);
137
- function $d981bcab8e24f2f3$export$a6b5be5c6b451665(props) {
138
- let ctx = (0, $eLNG1$react.useContext)($d981bcab8e24f2f3$var$FormContext);
139
- if (ctx) return {
140
- ...ctx,
141
- ...props
142
- };
143
- return props;
144
- }
145
- const $d981bcab8e24f2f3$var$formPropNames = new Set([
146
- "action",
147
- "autoComplete",
148
- "encType",
149
- "method",
150
- "target",
151
- "onSubmit",
152
- "onReset",
153
- "onInvalid"
154
- ]);
155
- function $d981bcab8e24f2f3$var$Form(props, ref) {
156
- props = (0, $eLNG1$reactspectrumprovider.useProviderProps)(props);
157
- 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;
158
- let { styleProps: styleProps } = (0, $eLNG1$reactspectrumutils.useStyleProps)(otherProps);
159
- let domRef = (0, $eLNG1$reactspectrumutils.useDOMRef)(ref);
160
- let ctx = {
161
- labelPosition: labelPosition,
162
- labelAlign: labelAlign,
163
- necessityIndicator: necessityIndicator,
164
- validationBehavior: validationBehavior
165
- };
166
- return /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement("form", {
167
- ...(0, $eLNG1$reactariautils.filterDOMProps)(otherProps, {
168
- labelable: true,
169
- propNames: $d981bcab8e24f2f3$var$formPropNames
170
- }),
171
- ...styleProps,
172
- noValidate: validationBehavior !== "native",
173
- ref: domRef,
174
- className: (0, $eLNG1$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($eb2fc0ee655eff6b$exports))), "spectrum-Form", {
175
- "spectrum-Form--positionSide": labelPosition === "side",
176
- "spectrum-Form--positionTop": labelPosition === "top"
177
- }, styleProps.className)
178
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement($d981bcab8e24f2f3$var$FormContext.Provider, {
179
- value: ctx
180
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement((0, $eLNG1$reactspectrumprovider.Provider), {
181
- isQuiet: isQuiet,
182
- isEmphasized: isEmphasized,
183
- isDisabled: isDisabled,
184
- isReadOnly: isReadOnly,
185
- isRequired: isRequired,
186
- validationState: validationState
187
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).createElement((0, $eLNG1$reactstatelyform.FormValidationContext).Provider, {
188
- value: validationErrors || {}
189
- }, children))));
190
- }
191
- /**
192
- * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
193
- */ const $d981bcab8e24f2f3$export$a7fed597f4b8afd8 = /*#__PURE__*/ (0, ($parcel$interopDefault($eLNG1$react))).forwardRef($d981bcab8e24f2f3$var$Form);
194
-
195
21
 
196
22
 
197
23
 
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 {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"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/form/src/index.ts"],"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"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,18 +1,5 @@
1
- import "./main.css";
2
- import {useStyleProps as $011V3$useStyleProps, useDOMRef as $011V3$useDOMRef, classNames as $011V3$classNames} from "@react-spectrum/utils";
3
- import {filterDOMProps as $011V3$filterDOMProps} from "@react-aria/utils";
4
- import {FormValidationContext as $011V3$FormValidationContext} from "@react-stately/form";
5
- import {useProviderProps as $011V3$useProviderProps, Provider as $011V3$Provider} from "@react-spectrum/provider";
6
- import $011V3$react, {useContext as $011V3$useContext} from "react";
1
+ import {Form as $ac118ceca79b8650$export$a7fed597f4b8afd8, useFormProps as $ac118ceca79b8650$export$a6b5be5c6b451665} from "./Form.module.js";
7
2
 
8
-
9
- function $parcel$interopDefault(a) {
10
- return a && a.__esModule ? a.default : a;
11
- }
12
-
13
- function $parcel$export(e, n, v, s) {
14
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
- }
16
3
  /*
17
4
  * Copyright 2020 Adobe. All rights reserved.
18
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -24,171 +11,6 @@ function $parcel$export(e, n, v, s) {
24
11
  * OF ANY KIND, either express or implied. See the License for the specific language
25
12
  * governing permissions and limitations under the License.
26
13
  */ /// <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
- */
38
-
39
-
40
-
41
-
42
- var $cd231e464c886c86$exports = {};
43
-
44
- $parcel$export($cd231e464c886c86$exports, "contextualHelp", () => $cd231e464c886c86$export$4ba534aba1836d, (v) => $cd231e464c886c86$export$4ba534aba1836d = v);
45
- $parcel$export($cd231e464c886c86$exports, "field", () => $cd231e464c886c86$export$e0f35d825088c098, (v) => $cd231e464c886c86$export$e0f35d825088c098 = v);
46
- $parcel$export($cd231e464c886c86$exports, "focus-ring", () => $cd231e464c886c86$export$f39a09f249340e2a, (v) => $cd231e464c886c86$export$f39a09f249340e2a = v);
47
- $parcel$export($cd231e464c886c86$exports, "helpText", () => $cd231e464c886c86$export$431a3b688422af44, (v) => $cd231e464c886c86$export$431a3b688422af44 = v);
48
- $parcel$export($cd231e464c886c86$exports, "i18nFontFamily", () => $cd231e464c886c86$export$8c4ee2c50c22c514, (v) => $cd231e464c886c86$export$8c4ee2c50c22c514 = v);
49
- $parcel$export($cd231e464c886c86$exports, "is-disabled", () => $cd231e464c886c86$export$d35bc1e505d1ebbf, (v) => $cd231e464c886c86$export$d35bc1e505d1ebbf = v);
50
- $parcel$export($cd231e464c886c86$exports, "label", () => $cd231e464c886c86$export$1237798dc640739a, (v) => $cd231e464c886c86$export$1237798dc640739a = v);
51
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field", () => $cd231e464c886c86$export$f6d480ae1e56eba0, (v) => $cd231e464c886c86$export$f6d480ae1e56eba0 = v);
52
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--alignEnd", () => $cd231e464c886c86$export$5354c9be7ada5f83, (v) => $cd231e464c886c86$export$5354c9be7ada5f83 = v);
53
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--hasContextualHelp", () => $cd231e464c886c86$export$9ba23707a252cdd4, (v) => $cd231e464c886c86$export$9ba23707a252cdd4 = v);
54
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionSide", () => $cd231e464c886c86$export$2963225c91179589, (v) => $cd231e464c886c86$export$2963225c91179589 = v);
55
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field--positionTop", () => $cd231e464c886c86$export$a4ea780a9064d7f9, (v) => $cd231e464c886c86$export$a4ea780a9064d7f9 = v);
56
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-contextualHelp", () => $cd231e464c886c86$export$24fb860d16dd2d3f, (v) => $cd231e464c886c86$export$24fb860d16dd2d3f = v);
57
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-field", () => $cd231e464c886c86$export$3ab8a3dc7f0563d, (v) => $cd231e464c886c86$export$3ab8a3dc7f0563d = v);
58
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-labelCell", () => $cd231e464c886c86$export$9cde5aecff012641, (v) => $cd231e464c886c86$export$9cde5aecff012641 = v);
59
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-labelWrapper", () => $cd231e464c886c86$export$a872a8c78b26c9e0, (v) => $cd231e464c886c86$export$a872a8c78b26c9e0 = v);
60
- $parcel$export($cd231e464c886c86$exports, "spectrum-Field-wrapper", () => $cd231e464c886c86$export$127df0b7290eb8ef, (v) => $cd231e464c886c86$export$127df0b7290eb8ef = v);
61
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel", () => $cd231e464c886c86$export$493d18e796ae054, (v) => $cd231e464c886c86$export$493d18e796ae054 = v);
62
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--alignEnd", () => $cd231e464c886c86$export$885efcc08143a987, (v) => $cd231e464c886c86$export$885efcc08143a987 = v);
63
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel--positionSide", () => $cd231e464c886c86$export$9e6f19dc21f22f2e, (v) => $cd231e464c886c86$export$9e6f19dc21f22f2e = v);
64
- $parcel$export($cd231e464c886c86$exports, "spectrum-FieldLabel-requiredIcon", () => $cd231e464c886c86$export$7c47642c7d46f3c9, (v) => $cd231e464c886c86$export$7c47642c7d46f3c9 = v);
65
- $parcel$export($cd231e464c886c86$exports, "spectrum-FocusRing-ring", () => $cd231e464c886c86$export$4109102f950813a6, (v) => $cd231e464c886c86$export$4109102f950813a6 = v);
66
- $parcel$export($cd231e464c886c86$exports, "spectrum-FocusRing", () => $cd231e464c886c86$export$24c7f46a6e3605dd, (v) => $cd231e464c886c86$export$24c7f46a6e3605dd = v);
67
- $parcel$export($cd231e464c886c86$exports, "spectrum-FocusRing--quiet", () => $cd231e464c886c86$export$2927016961429360, (v) => $cd231e464c886c86$export$2927016961429360 = v);
68
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form", () => $cd231e464c886c86$export$94d2bcc94afabd89, (v) => $cd231e464c886c86$export$94d2bcc94afabd89 = v);
69
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form--positionSide", () => $cd231e464c886c86$export$7f44db659563c8f4, (v) => $cd231e464c886c86$export$7f44db659563c8f4 = v);
70
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form--positionTop", () => $cd231e464c886c86$export$11b8bc81fe551057, (v) => $cd231e464c886c86$export$11b8bc81fe551057 = v);
71
- $parcel$export($cd231e464c886c86$exports, "spectrum-Form-itemLabel", () => $cd231e464c886c86$export$51ec27881a1e3928, (v) => $cd231e464c886c86$export$51ec27881a1e3928 = v);
72
- $parcel$export($cd231e464c886c86$exports, "spectrum-LabeledValue", () => $cd231e464c886c86$export$79f9a5e9dd010c8d, (v) => $cd231e464c886c86$export$79f9a5e9dd010c8d = v);
73
- var $cd231e464c886c86$export$4ba534aba1836d;
74
- var $cd231e464c886c86$export$e0f35d825088c098;
75
- var $cd231e464c886c86$export$f39a09f249340e2a;
76
- var $cd231e464c886c86$export$431a3b688422af44;
77
- var $cd231e464c886c86$export$8c4ee2c50c22c514;
78
- var $cd231e464c886c86$export$d35bc1e505d1ebbf;
79
- var $cd231e464c886c86$export$1237798dc640739a;
80
- var $cd231e464c886c86$export$f6d480ae1e56eba0;
81
- var $cd231e464c886c86$export$5354c9be7ada5f83;
82
- var $cd231e464c886c86$export$9ba23707a252cdd4;
83
- var $cd231e464c886c86$export$2963225c91179589;
84
- var $cd231e464c886c86$export$a4ea780a9064d7f9;
85
- var $cd231e464c886c86$export$24fb860d16dd2d3f;
86
- var $cd231e464c886c86$export$3ab8a3dc7f0563d;
87
- var $cd231e464c886c86$export$9cde5aecff012641;
88
- var $cd231e464c886c86$export$a872a8c78b26c9e0;
89
- var $cd231e464c886c86$export$127df0b7290eb8ef;
90
- var $cd231e464c886c86$export$493d18e796ae054;
91
- var $cd231e464c886c86$export$885efcc08143a987;
92
- var $cd231e464c886c86$export$9e6f19dc21f22f2e;
93
- var $cd231e464c886c86$export$7c47642c7d46f3c9;
94
- var $cd231e464c886c86$export$4109102f950813a6;
95
- var $cd231e464c886c86$export$24c7f46a6e3605dd;
96
- var $cd231e464c886c86$export$2927016961429360;
97
- var $cd231e464c886c86$export$94d2bcc94afabd89;
98
- var $cd231e464c886c86$export$7f44db659563c8f4;
99
- var $cd231e464c886c86$export$11b8bc81fe551057;
100
- var $cd231e464c886c86$export$51ec27881a1e3928;
101
- var $cd231e464c886c86$export$79f9a5e9dd010c8d;
102
- $cd231e464c886c86$export$4ba534aba1836d = `A-HlBa_contextualHelp`;
103
- $cd231e464c886c86$export$e0f35d825088c098 = `A-HlBa_field`;
104
- $cd231e464c886c86$export$f39a09f249340e2a = `A-HlBa_focus-ring`;
105
- $cd231e464c886c86$export$431a3b688422af44 = `A-HlBa_helpText`;
106
- $cd231e464c886c86$export$8c4ee2c50c22c514 = `A-HlBa_i18nFontFamily`;
107
- $cd231e464c886c86$export$d35bc1e505d1ebbf = `A-HlBa_is-disabled`;
108
- $cd231e464c886c86$export$1237798dc640739a = `A-HlBa_label`;
109
- $cd231e464c886c86$export$f6d480ae1e56eba0 = `A-HlBa_spectrum-Field`;
110
- $cd231e464c886c86$export$5354c9be7ada5f83 = `A-HlBa_spectrum-Field--alignEnd`;
111
- $cd231e464c886c86$export$9ba23707a252cdd4 = `A-HlBa_spectrum-Field--hasContextualHelp`;
112
- $cd231e464c886c86$export$2963225c91179589 = `A-HlBa_spectrum-Field--positionSide`;
113
- $cd231e464c886c86$export$a4ea780a9064d7f9 = `A-HlBa_spectrum-Field--positionTop`;
114
- $cd231e464c886c86$export$24fb860d16dd2d3f = `A-HlBa_spectrum-Field-contextualHelp`;
115
- $cd231e464c886c86$export$3ab8a3dc7f0563d = `A-HlBa_spectrum-Field-field`;
116
- $cd231e464c886c86$export$9cde5aecff012641 = `A-HlBa_spectrum-Field-labelCell`;
117
- $cd231e464c886c86$export$a872a8c78b26c9e0 = `A-HlBa_spectrum-Field-labelWrapper`;
118
- $cd231e464c886c86$export$127df0b7290eb8ef = `A-HlBa_spectrum-Field-wrapper`;
119
- $cd231e464c886c86$export$493d18e796ae054 = `A-HlBa_spectrum-FieldLabel`;
120
- $cd231e464c886c86$export$885efcc08143a987 = `A-HlBa_spectrum-FieldLabel--alignEnd`;
121
- $cd231e464c886c86$export$9e6f19dc21f22f2e = `A-HlBa_spectrum-FieldLabel--positionSide`;
122
- $cd231e464c886c86$export$7c47642c7d46f3c9 = `A-HlBa_spectrum-FieldLabel-requiredIcon`;
123
- $cd231e464c886c86$export$4109102f950813a6 = `A-HlBa_spectrum-FocusRing-ring`;
124
- $cd231e464c886c86$export$24c7f46a6e3605dd = `A-HlBa_spectrum-FocusRing ${$cd231e464c886c86$export$4109102f950813a6}`;
125
- $cd231e464c886c86$export$2927016961429360 = `A-HlBa_spectrum-FocusRing--quiet`;
126
- $cd231e464c886c86$export$94d2bcc94afabd89 = `A-HlBa_spectrum-Form`;
127
- $cd231e464c886c86$export$7f44db659563c8f4 = `A-HlBa_spectrum-Form--positionSide`;
128
- $cd231e464c886c86$export$11b8bc81fe551057 = `A-HlBa_spectrum-Form--positionTop`;
129
- $cd231e464c886c86$export$51ec27881a1e3928 = `A-HlBa_spectrum-Form-itemLabel`;
130
- $cd231e464c886c86$export$79f9a5e9dd010c8d = `A-HlBa_spectrum-LabeledValue`;
131
-
132
-
133
- let $ac118ceca79b8650$var$FormContext = /*#__PURE__*/ (0, $011V3$react).createContext(null);
134
- function $ac118ceca79b8650$export$a6b5be5c6b451665(props) {
135
- let ctx = (0, $011V3$useContext)($ac118ceca79b8650$var$FormContext);
136
- if (ctx) return {
137
- ...ctx,
138
- ...props
139
- };
140
- return props;
141
- }
142
- const $ac118ceca79b8650$var$formPropNames = new Set([
143
- "action",
144
- "autoComplete",
145
- "encType",
146
- "method",
147
- "target",
148
- "onSubmit",
149
- "onReset",
150
- "onInvalid"
151
- ]);
152
- function $ac118ceca79b8650$var$Form(props, ref) {
153
- props = (0, $011V3$useProviderProps)(props);
154
- 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;
155
- let { styleProps: styleProps } = (0, $011V3$useStyleProps)(otherProps);
156
- let domRef = (0, $011V3$useDOMRef)(ref);
157
- let ctx = {
158
- labelPosition: labelPosition,
159
- labelAlign: labelAlign,
160
- necessityIndicator: necessityIndicator,
161
- validationBehavior: validationBehavior
162
- };
163
- return /*#__PURE__*/ (0, $011V3$react).createElement("form", {
164
- ...(0, $011V3$filterDOMProps)(otherProps, {
165
- labelable: true,
166
- propNames: $ac118ceca79b8650$var$formPropNames
167
- }),
168
- ...styleProps,
169
- noValidate: validationBehavior !== "native",
170
- ref: domRef,
171
- className: (0, $011V3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports))), "spectrum-Form", {
172
- "spectrum-Form--positionSide": labelPosition === "side",
173
- "spectrum-Form--positionTop": labelPosition === "top"
174
- }, styleProps.className)
175
- }, /*#__PURE__*/ (0, $011V3$react).createElement($ac118ceca79b8650$var$FormContext.Provider, {
176
- value: ctx
177
- }, /*#__PURE__*/ (0, $011V3$react).createElement((0, $011V3$Provider), {
178
- isQuiet: isQuiet,
179
- isEmphasized: isEmphasized,
180
- isDisabled: isDisabled,
181
- isReadOnly: isReadOnly,
182
- isRequired: isRequired,
183
- validationState: validationState
184
- }, /*#__PURE__*/ (0, $011V3$react).createElement((0, $011V3$FormValidationContext).Provider, {
185
- value: validationErrors || {}
186
- }, children))));
187
- }
188
- /**
189
- * Forms allow users to enter data that can be submitted while providing alignment and styling for form fields.
190
- */ const $ac118ceca79b8650$export$a7fed597f4b8afd8 = /*#__PURE__*/ (0, $011V3$react).forwardRef($ac118ceca79b8650$var$Form);
191
-
192
14
 
193
15
 
194
16
 
@@ -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 {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
+ {"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/form/src/index.ts"],"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"],"names":[],"version":3,"file":"module.js.map"}