@react-spectrum/labeledvalue 3.1.13-nightly.4555 → 3.1.13-nightly.4558

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.js CHANGED
@@ -1,21 +1,11 @@
1
- require("./main.css");
2
- var $3cJLQ$internationalizeddate = require("@internationalized/date");
3
- var $3cJLQ$reactspectrumutils = require("@react-spectrum/utils");
4
- var $3cJLQ$reactspectrumlabel = require("@react-spectrum/label");
5
- var $3cJLQ$reactariautils = require("@react-aria/utils");
6
- var $3cJLQ$react = require("react");
7
- var $3cJLQ$reactariai18n = require("@react-aria/i18n");
1
+ var $2a7417c2df2197f7$exports = require("./LabeledValue.main.js");
8
2
 
9
3
 
10
4
  function $parcel$export(e, n, v, s) {
11
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
6
  }
13
7
 
14
- function $parcel$interopDefault(a) {
15
- return a && a.__esModule ? a.default : a;
16
- }
17
-
18
- $parcel$export(module.exports, "LabeledValue", () => $2a7417c2df2197f7$export$d1328f67a56fa517);
8
+ $parcel$export(module.exports, "LabeledValue", () => $2a7417c2df2197f7$exports.LabeledValue);
19
9
  /*
20
10
  * Copyright 2022 Adobe. All rights reserved.
21
11
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -27,211 +17,6 @@ $parcel$export(module.exports, "LabeledValue", () => $2a7417c2df2197f7$export$d1
27
17
  * OF ANY KIND, either express or implied. See the License for the specific language
28
18
  * governing permissions and limitations under the License.
29
19
  */ /// <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
- var $eb2fc0ee655eff6b$exports = {};
45
-
46
- $parcel$export($eb2fc0ee655eff6b$exports, "contextualHelp", () => $eb2fc0ee655eff6b$export$4ba534aba1836d, (v) => $eb2fc0ee655eff6b$export$4ba534aba1836d = v);
47
- $parcel$export($eb2fc0ee655eff6b$exports, "field", () => $eb2fc0ee655eff6b$export$e0f35d825088c098, (v) => $eb2fc0ee655eff6b$export$e0f35d825088c098 = v);
48
- $parcel$export($eb2fc0ee655eff6b$exports, "focus-ring", () => $eb2fc0ee655eff6b$export$f39a09f249340e2a, (v) => $eb2fc0ee655eff6b$export$f39a09f249340e2a = v);
49
- $parcel$export($eb2fc0ee655eff6b$exports, "helpText", () => $eb2fc0ee655eff6b$export$431a3b688422af44, (v) => $eb2fc0ee655eff6b$export$431a3b688422af44 = v);
50
- $parcel$export($eb2fc0ee655eff6b$exports, "i18nFontFamily", () => $eb2fc0ee655eff6b$export$8c4ee2c50c22c514, (v) => $eb2fc0ee655eff6b$export$8c4ee2c50c22c514 = v);
51
- $parcel$export($eb2fc0ee655eff6b$exports, "is-disabled", () => $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf, (v) => $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf = v);
52
- $parcel$export($eb2fc0ee655eff6b$exports, "label", () => $eb2fc0ee655eff6b$export$1237798dc640739a, (v) => $eb2fc0ee655eff6b$export$1237798dc640739a = v);
53
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field", () => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0, (v) => $eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = v);
54
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--alignEnd", () => $eb2fc0ee655eff6b$export$5354c9be7ada5f83, (v) => $eb2fc0ee655eff6b$export$5354c9be7ada5f83 = v);
55
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--hasContextualHelp", () => $eb2fc0ee655eff6b$export$9ba23707a252cdd4, (v) => $eb2fc0ee655eff6b$export$9ba23707a252cdd4 = v);
56
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionSide", () => $eb2fc0ee655eff6b$export$2963225c91179589, (v) => $eb2fc0ee655eff6b$export$2963225c91179589 = v);
57
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field--positionTop", () => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9, (v) => $eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = v);
58
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-contextualHelp", () => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f, (v) => $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = v);
59
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-field", () => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d, (v) => $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = v);
60
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-labelCell", () => $eb2fc0ee655eff6b$export$9cde5aecff012641, (v) => $eb2fc0ee655eff6b$export$9cde5aecff012641 = v);
61
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-labelWrapper", () => $eb2fc0ee655eff6b$export$a872a8c78b26c9e0, (v) => $eb2fc0ee655eff6b$export$a872a8c78b26c9e0 = v);
62
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Field-wrapper", () => $eb2fc0ee655eff6b$export$127df0b7290eb8ef, (v) => $eb2fc0ee655eff6b$export$127df0b7290eb8ef = v);
63
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel", () => $eb2fc0ee655eff6b$export$493d18e796ae054, (v) => $eb2fc0ee655eff6b$export$493d18e796ae054 = v);
64
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--alignEnd", () => $eb2fc0ee655eff6b$export$885efcc08143a987, (v) => $eb2fc0ee655eff6b$export$885efcc08143a987 = v);
65
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel--positionSide", () => $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e, (v) => $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e = v);
66
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FieldLabel-requiredIcon", () => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9, (v) => $eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = v);
67
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FocusRing-ring", () => $eb2fc0ee655eff6b$export$4109102f950813a6, (v) => $eb2fc0ee655eff6b$export$4109102f950813a6 = v);
68
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FocusRing", () => $eb2fc0ee655eff6b$export$24c7f46a6e3605dd, (v) => $eb2fc0ee655eff6b$export$24c7f46a6e3605dd = v);
69
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-FocusRing--quiet", () => $eb2fc0ee655eff6b$export$2927016961429360, (v) => $eb2fc0ee655eff6b$export$2927016961429360 = v);
70
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form", () => $eb2fc0ee655eff6b$export$94d2bcc94afabd89, (v) => $eb2fc0ee655eff6b$export$94d2bcc94afabd89 = v);
71
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form--positionSide", () => $eb2fc0ee655eff6b$export$7f44db659563c8f4, (v) => $eb2fc0ee655eff6b$export$7f44db659563c8f4 = v);
72
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form--positionTop", () => $eb2fc0ee655eff6b$export$11b8bc81fe551057, (v) => $eb2fc0ee655eff6b$export$11b8bc81fe551057 = v);
73
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-Form-itemLabel", () => $eb2fc0ee655eff6b$export$51ec27881a1e3928, (v) => $eb2fc0ee655eff6b$export$51ec27881a1e3928 = v);
74
- $parcel$export($eb2fc0ee655eff6b$exports, "spectrum-LabeledValue", () => $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d, (v) => $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d = v);
75
- var $eb2fc0ee655eff6b$export$4ba534aba1836d;
76
- var $eb2fc0ee655eff6b$export$e0f35d825088c098;
77
- var $eb2fc0ee655eff6b$export$f39a09f249340e2a;
78
- var $eb2fc0ee655eff6b$export$431a3b688422af44;
79
- var $eb2fc0ee655eff6b$export$8c4ee2c50c22c514;
80
- var $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf;
81
- var $eb2fc0ee655eff6b$export$1237798dc640739a;
82
- var $eb2fc0ee655eff6b$export$f6d480ae1e56eba0;
83
- var $eb2fc0ee655eff6b$export$5354c9be7ada5f83;
84
- var $eb2fc0ee655eff6b$export$9ba23707a252cdd4;
85
- var $eb2fc0ee655eff6b$export$2963225c91179589;
86
- var $eb2fc0ee655eff6b$export$a4ea780a9064d7f9;
87
- var $eb2fc0ee655eff6b$export$24fb860d16dd2d3f;
88
- var $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d;
89
- var $eb2fc0ee655eff6b$export$9cde5aecff012641;
90
- var $eb2fc0ee655eff6b$export$a872a8c78b26c9e0;
91
- var $eb2fc0ee655eff6b$export$127df0b7290eb8ef;
92
- var $eb2fc0ee655eff6b$export$493d18e796ae054;
93
- var $eb2fc0ee655eff6b$export$885efcc08143a987;
94
- var $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e;
95
- var $eb2fc0ee655eff6b$export$7c47642c7d46f3c9;
96
- var $eb2fc0ee655eff6b$export$4109102f950813a6;
97
- var $eb2fc0ee655eff6b$export$24c7f46a6e3605dd;
98
- var $eb2fc0ee655eff6b$export$2927016961429360;
99
- var $eb2fc0ee655eff6b$export$94d2bcc94afabd89;
100
- var $eb2fc0ee655eff6b$export$7f44db659563c8f4;
101
- var $eb2fc0ee655eff6b$export$11b8bc81fe551057;
102
- var $eb2fc0ee655eff6b$export$51ec27881a1e3928;
103
- var $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d;
104
- $eb2fc0ee655eff6b$export$4ba534aba1836d = `A-HlBa_contextualHelp`;
105
- $eb2fc0ee655eff6b$export$e0f35d825088c098 = `A-HlBa_field`;
106
- $eb2fc0ee655eff6b$export$f39a09f249340e2a = `A-HlBa_focus-ring`;
107
- $eb2fc0ee655eff6b$export$431a3b688422af44 = `A-HlBa_helpText`;
108
- $eb2fc0ee655eff6b$export$8c4ee2c50c22c514 = `A-HlBa_i18nFontFamily`;
109
- $eb2fc0ee655eff6b$export$d35bc1e505d1ebbf = `A-HlBa_is-disabled`;
110
- $eb2fc0ee655eff6b$export$1237798dc640739a = `A-HlBa_label`;
111
- $eb2fc0ee655eff6b$export$f6d480ae1e56eba0 = `A-HlBa_spectrum-Field`;
112
- $eb2fc0ee655eff6b$export$5354c9be7ada5f83 = `A-HlBa_spectrum-Field--alignEnd`;
113
- $eb2fc0ee655eff6b$export$9ba23707a252cdd4 = `A-HlBa_spectrum-Field--hasContextualHelp`;
114
- $eb2fc0ee655eff6b$export$2963225c91179589 = `A-HlBa_spectrum-Field--positionSide`;
115
- $eb2fc0ee655eff6b$export$a4ea780a9064d7f9 = `A-HlBa_spectrum-Field--positionTop`;
116
- $eb2fc0ee655eff6b$export$24fb860d16dd2d3f = `A-HlBa_spectrum-Field-contextualHelp`;
117
- $eb2fc0ee655eff6b$export$3ab8a3dc7f0563d = `A-HlBa_spectrum-Field-field`;
118
- $eb2fc0ee655eff6b$export$9cde5aecff012641 = `A-HlBa_spectrum-Field-labelCell`;
119
- $eb2fc0ee655eff6b$export$a872a8c78b26c9e0 = `A-HlBa_spectrum-Field-labelWrapper`;
120
- $eb2fc0ee655eff6b$export$127df0b7290eb8ef = `A-HlBa_spectrum-Field-wrapper`;
121
- $eb2fc0ee655eff6b$export$493d18e796ae054 = `A-HlBa_spectrum-FieldLabel`;
122
- $eb2fc0ee655eff6b$export$885efcc08143a987 = `A-HlBa_spectrum-FieldLabel--alignEnd`;
123
- $eb2fc0ee655eff6b$export$9e6f19dc21f22f2e = `A-HlBa_spectrum-FieldLabel--positionSide`;
124
- $eb2fc0ee655eff6b$export$7c47642c7d46f3c9 = `A-HlBa_spectrum-FieldLabel-requiredIcon`;
125
- $eb2fc0ee655eff6b$export$4109102f950813a6 = `A-HlBa_spectrum-FocusRing-ring`;
126
- $eb2fc0ee655eff6b$export$24c7f46a6e3605dd = `A-HlBa_spectrum-FocusRing ${$eb2fc0ee655eff6b$export$4109102f950813a6}`;
127
- $eb2fc0ee655eff6b$export$2927016961429360 = `A-HlBa_spectrum-FocusRing--quiet`;
128
- $eb2fc0ee655eff6b$export$94d2bcc94afabd89 = `A-HlBa_spectrum-Form`;
129
- $eb2fc0ee655eff6b$export$7f44db659563c8f4 = `A-HlBa_spectrum-Form--positionSide`;
130
- $eb2fc0ee655eff6b$export$11b8bc81fe551057 = `A-HlBa_spectrum-Form--positionTop`;
131
- $eb2fc0ee655eff6b$export$51ec27881a1e3928 = `A-HlBa_spectrum-Form-itemLabel`;
132
- $eb2fc0ee655eff6b$export$79f9a5e9dd010c8d = `A-HlBa_spectrum-LabeledValue`;
133
-
134
-
135
-
136
-
137
- function $2a7417c2df2197f7$var$LabeledValue(props, ref) {
138
- let { value: value, formatOptions: formatOptions } = props;
139
- let domRef = (0, $3cJLQ$reactspectrumutils.useDOMRef)(ref);
140
- let children;
141
- if (Array.isArray(value)) children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedStringList, {
142
- value: value,
143
- formatOptions: formatOptions
144
- });
145
- if (typeof value === "object" && "start" in value && typeof value.start === "number" && typeof value.end === "number") children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedNumber, {
146
- value: value,
147
- formatOptions: formatOptions
148
- });
149
- if (typeof value === "object" && "start" in value && typeof value.start !== "number" && typeof value.end !== "number") children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedDate, {
150
- value: value,
151
- formatOptions: formatOptions
152
- });
153
- if (typeof value === "number") children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedNumber, {
154
- value: value,
155
- formatOptions: formatOptions
156
- });
157
- if (typeof value === "object" && ("calendar" in value || "hour" in value) || value instanceof Date) children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement($2a7417c2df2197f7$var$FormattedDate, {
158
- value: value,
159
- formatOptions: formatOptions
160
- });
161
- if (typeof value === "string") children = value;
162
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, $3cJLQ$reactspectrumlabel.Field), {
163
- ...props,
164
- wrapperProps: (0, $3cJLQ$reactariautils.filterDOMProps)(props),
165
- ref: domRef,
166
- elementType: "span",
167
- wrapperClassName: (0, $3cJLQ$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($eb2fc0ee655eff6b$exports))), "spectrum-LabeledValue")
168
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement("span", null, children));
169
- }
170
- function $2a7417c2df2197f7$var$FormattedStringList(props) {
171
- let stringFormatter = (0, $3cJLQ$reactariai18n.useListFormatter)(props.formatOptions);
172
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, stringFormatter.format(props.value));
173
- }
174
- function $2a7417c2df2197f7$var$FormattedNumber(props) {
175
- let numberFormatter = (0, $3cJLQ$reactariai18n.useNumberFormatter)(props.formatOptions);
176
- let value = props.value;
177
- if (typeof value === "object") return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, numberFormatter.formatRange(value.start, value.end));
178
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, numberFormatter.format(value));
179
- }
180
- function $2a7417c2df2197f7$var$FormattedDate(props) {
181
- let { value: value, formatOptions: formatOptions } = props;
182
- if (!formatOptions) formatOptions = $2a7417c2df2197f7$var$getDefaultFormatOptions("start" in value ? value.start : value);
183
- let dateFormatter = (0, $3cJLQ$reactariai18n.useDateFormatter)(formatOptions);
184
- let timeZone = dateFormatter.resolvedOptions().timeZone || (0, $3cJLQ$internationalizeddate.getLocalTimeZone)();
185
- let final;
186
- if ("start" in value && "end" in value) {
187
- let start = value.start;
188
- let end = value.end;
189
- start = $2a7417c2df2197f7$var$convertDateTime(start, timeZone);
190
- end = $2a7417c2df2197f7$var$convertDateTime(end, timeZone);
191
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, dateFormatter.formatRange(start, end));
192
- }
193
- final = $2a7417c2df2197f7$var$convertDateTime(value, timeZone);
194
- return /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).createElement((0, ($parcel$interopDefault($3cJLQ$react))).Fragment, null, dateFormatter.format(final));
195
- }
196
- function $2a7417c2df2197f7$var$convertDateTime(value, timeZone) {
197
- if ("timeZone" in value) return value.toDate();
198
- else if ("calendar" in value) return value.toDate(timeZone);
199
- else if (!(value instanceof Date)) return $2a7417c2df2197f7$var$convertValue(value).toDate(timeZone);
200
- return value;
201
- }
202
- function $2a7417c2df2197f7$var$getDefaultFormatOptions(value) {
203
- if (value instanceof Date) return {
204
- dateStyle: "long",
205
- timeStyle: "short"
206
- };
207
- else if ("timeZone" in value) return {
208
- year: "numeric",
209
- month: "long",
210
- day: "numeric",
211
- hour: "numeric",
212
- minute: "numeric",
213
- timeZone: value.timeZone,
214
- timeZoneName: "short"
215
- };
216
- else if ("hour" in value && "year" in value) return {
217
- dateStyle: "long",
218
- timeStyle: "short"
219
- };
220
- else if ("hour" in value) return {
221
- timeStyle: "short"
222
- };
223
- else return {
224
- dateStyle: "long"
225
- };
226
- }
227
- function $2a7417c2df2197f7$var$convertValue(value) {
228
- let date = (0, $3cJLQ$internationalizeddate.today)((0, $3cJLQ$internationalizeddate.getLocalTimeZone)());
229
- return (0, $3cJLQ$internationalizeddate.toCalendarDateTime)(date, value);
230
- }
231
- /**
232
- * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
233
- */ let $2a7417c2df2197f7$export$d1328f67a56fa517 = /*#__PURE__*/ (0, ($parcel$interopDefault($3cJLQ$react))).forwardRef($2a7417c2df2197f7$var$LabeledValue);
234
-
235
20
 
236
21
 
237
22
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD,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;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5BA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA6B,CAAC,eAAe,CAAC;AAC9C,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAi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,sCAAgB,KAAK;QAE3B,qBAAO,sHAAG,cAAc,WAAW,CAAC,OAAO;IAC7C;IAEA,QAAQ,sCAAgB,OAAO;IAC/B,qBAAO,sHAAG,cAAc,MAAM,CAAC;AACjC;AAEA,SAAS,sCAAgB,KAAe,EAAE,QAAa;IACrD,IAAI,cAAc,OAChB,OAAO,MAAM,MAAM;SACd,IAAI,cAAc,OACvB,OAAO,MAAM,MAAM,CAAC;SACf,IAAI,CAAE,CAAA,iBAAiB,IAAG,GAC/B,OAAO,mCAAa,OAAO,MAAM,CAAC;IAGpC,OAAO;AACT;AAEA,SAAS,8CAAwB,KAAe;IAC9C,IAAI,iBAAiB,MACnB,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,cAAc,OACvB,OAAO;QAAC,MAAM;QAAW,OAAO;QAAQ,KAAK;QAAW,MAAM;QAAW,QAAQ;QAAW,UAAU,MAAM,QAAQ;QAAE,cAAc;IAAO;SACtI,IAAI,UAAU,SAAS,UAAU,OACtC,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,UAAU,OACnB,OAAO;QAAC,WAAW;IAAO;SAE1B,OAAO;QAAC,WAAW;IAAM;AAE7B;AAEA,SAAS,mCAAa,KAAW;IAC/B,IAAI,OAAO,CAAA,GAAA,kCAAI,EAAE,CAAA,GAAA,6CAAe;IAEhC,OAAO,CAAA,GAAA,+CAAiB,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2022 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 type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\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 {CalendarDate, CalendarDateTime, getLocalTimeZone, Time, toCalendarDateTime, today, ZonedDateTime} from '@internationalized/date';\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport type {DOMProps, DOMRef, RangeValue, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps} from '@react-aria/utils';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport React, {ReactNode} from 'react';\nimport {useDateFormatter, useListFormatter, useNumberFormatter} from '@react-aria/i18n';\n\n// NOTE: the types here need to be synchronized with the ones in docs/types.ts, which are simpler so the documentation generator can handle them.\n\nexport interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, DOMProps {\n /** The content to display as the label. */\n label: ReactNode\n}\n\ntype NumberValue = number | RangeValue<number>;\ninterface NumberProps<T extends NumberValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport type DateTime = Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time;\ntype RangeDateTime = RangeValue<DateTime>;\ntype DateTimeValue = DateTime | RangeDateTime;\ninterface DateProps<T extends DateTimeValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.DateTimeFormatOptions\n}\n\ninterface StringProps<T extends string> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: never\n}\n\ninterface StringListProps<T extends string[]> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.ListFormatOptions\n}\n\ntype LabeledValueProps<T> =\n T extends NumberValue ? NumberProps<T> :\n T extends DateTimeValue ? DateProps<T> :\n T extends string[] ? StringListProps<T> :\n T extends string ? StringProps<T> :\n never;\n\ntype SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue<number> | RangeValue<DateTime>;\nexport type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBaseProps;\n\nfunction LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {\n let {\n value,\n formatOptions\n } = props;\n let domRef = useDOMRef(ref);\n\n let children;\n if (Array.isArray(value)) {\n children = <FormattedStringList value={value} formatOptions={formatOptions as Intl.ListFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start === 'number' && typeof value.end === 'number') {\n children = <FormattedNumber value={value as NumberValue} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start !== 'number' && typeof value.end !== 'number') {\n children = <FormattedDate value={value as DateTimeValue} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'number') {\n children = <FormattedNumber value={value} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && ('calendar' in value || 'hour' in value) || (value instanceof Date)) {\n children = <FormattedDate value={value} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'string') {\n children = value;\n }\n\n return (\n <Field {...props as any} wrapperProps={filterDOMProps(props as any)} ref={domRef} elementType=\"span\" wrapperClassName={classNames(labelStyles, 'spectrum-LabeledValue')}>\n <span>{children}</span>\n </Field>\n );\n}\n\nfunction FormattedStringList<T extends string[]>(props: StringListProps<T>) {\n let stringFormatter = useListFormatter(props.formatOptions);\n\n return (\n <>{stringFormatter.format(props.value)}</>\n );\n}\n\nfunction FormattedNumber<T extends NumberValue>(props: NumberProps<T>) {\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let value = props.value;\n\n if (typeof value === 'object') {\n return <>{numberFormatter.formatRange(value.start, value.end)}</>;\n }\n\n return <>{numberFormatter.format(value)}</>;\n}\n\nfunction FormattedDate<T extends DateTimeValue>(props: DateProps<T>) {\n let {value, formatOptions} = props;\n if (!formatOptions) {\n formatOptions = getDefaultFormatOptions('start' in value ? value.start : value);\n }\n\n let dateFormatter = useDateFormatter(formatOptions);\n let timeZone = dateFormatter.resolvedOptions().timeZone || getLocalTimeZone();\n let final: Date;\n\n if ('start' in value && 'end' in value) {\n let start = value.start;\n let end = value.end;\n\n start = convertDateTime(start, timeZone);\n end = convertDateTime(end, timeZone);\n\n return <>{dateFormatter.formatRange(start, end)}</>;\n }\n\n final = convertDateTime(value, timeZone);\n return <>{dateFormatter.format(final)}</>;\n}\n\nfunction convertDateTime(value: DateTime, timeZone: any) {\n if ('timeZone' in value) {\n return value.toDate();\n } else if ('calendar' in value) {\n return value.toDate(timeZone);\n } else if (!(value instanceof Date)) {\n return convertValue(value).toDate(timeZone);\n }\n\n return value;\n}\n\nfunction getDefaultFormatOptions(value: DateTime): Intl.DateTimeFormatOptions {\n if (value instanceof Date) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('timeZone' in value) {\n return {year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: value.timeZone, timeZoneName: 'short'};\n } else if ('hour' in value && 'year' in value) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('hour' in value) {\n return {timeStyle: 'short'};\n } else {\n return {dateStyle: 'long'};\n }\n}\n\nfunction convertValue(value: Time) {\n let date = today(getLocalTimeZone());\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.\n */\nlet _LabeledValue = React.forwardRef(LabeledValue);\nexport {_LabeledValue as LabeledValue};\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/labeledvalue/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 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 type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,19 +1,5 @@
1
- import "./module.css";
2
- import {getLocalTimeZone as $3xnHL$getLocalTimeZone, today as $3xnHL$today, toCalendarDateTime as $3xnHL$toCalendarDateTime} from "@internationalized/date";
3
- import {useDOMRef as $3xnHL$useDOMRef, classNames as $3xnHL$classNames} from "@react-spectrum/utils";
4
- import {Field as $3xnHL$Field} from "@react-spectrum/label";
5
- import {filterDOMProps as $3xnHL$filterDOMProps} from "@react-aria/utils";
6
- import $3xnHL$react from "react";
7
- import {useListFormatter as $3xnHL$useListFormatter, useNumberFormatter as $3xnHL$useNumberFormatter, useDateFormatter as $3xnHL$useDateFormatter} from "@react-aria/i18n";
1
+ import {LabeledValue as $3e9971be431adb24$export$d1328f67a56fa517} from "./LabeledValue.module.js";
8
2
 
9
-
10
- function $parcel$interopDefault(a) {
11
- return a && a.__esModule ? a.default : a;
12
- }
13
-
14
- function $parcel$export(e, n, v, s) {
15
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
16
- }
17
3
  /*
18
4
  * Copyright 2022 Adobe. All rights reserved.
19
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -25,211 +11,6 @@ function $parcel$export(e, n, v, s) {
25
11
  * OF ANY KIND, either express or implied. See the License for the specific language
26
12
  * governing permissions and limitations under the License.
27
13
  */ /// <reference types="css-module-types" />
28
- /*
29
- * Copyright 2020 Adobe. All rights reserved.
30
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
31
- * you may not use this file except in compliance with the License. You may obtain a copy
32
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
33
- *
34
- * Unless required by applicable law or agreed to in writing, software distributed under
35
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
36
- * OF ANY KIND, either express or implied. See the License for the specific language
37
- * governing permissions and limitations under the License.
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
-
134
-
135
- function $3e9971be431adb24$var$LabeledValue(props, ref) {
136
- let { value: value, formatOptions: formatOptions } = props;
137
- let domRef = (0, $3xnHL$useDOMRef)(ref);
138
- let children;
139
- if (Array.isArray(value)) children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedStringList, {
140
- value: value,
141
- formatOptions: formatOptions
142
- });
143
- if (typeof value === "object" && "start" in value && typeof value.start === "number" && typeof value.end === "number") children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedNumber, {
144
- value: value,
145
- formatOptions: formatOptions
146
- });
147
- if (typeof value === "object" && "start" in value && typeof value.start !== "number" && typeof value.end !== "number") children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedDate, {
148
- value: value,
149
- formatOptions: formatOptions
150
- });
151
- if (typeof value === "number") children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedNumber, {
152
- value: value,
153
- formatOptions: formatOptions
154
- });
155
- if (typeof value === "object" && ("calendar" in value || "hour" in value) || value instanceof Date) children = /*#__PURE__*/ (0, $3xnHL$react).createElement($3e9971be431adb24$var$FormattedDate, {
156
- value: value,
157
- formatOptions: formatOptions
158
- });
159
- if (typeof value === "string") children = value;
160
- return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$Field), {
161
- ...props,
162
- wrapperProps: (0, $3xnHL$filterDOMProps)(props),
163
- ref: domRef,
164
- elementType: "span",
165
- wrapperClassName: (0, $3xnHL$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cd231e464c886c86$exports))), "spectrum-LabeledValue")
166
- }, /*#__PURE__*/ (0, $3xnHL$react).createElement("span", null, children));
167
- }
168
- function $3e9971be431adb24$var$FormattedStringList(props) {
169
- let stringFormatter = (0, $3xnHL$useListFormatter)(props.formatOptions);
170
- return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, stringFormatter.format(props.value));
171
- }
172
- function $3e9971be431adb24$var$FormattedNumber(props) {
173
- let numberFormatter = (0, $3xnHL$useNumberFormatter)(props.formatOptions);
174
- let value = props.value;
175
- if (typeof value === "object") return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, numberFormatter.formatRange(value.start, value.end));
176
- return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, numberFormatter.format(value));
177
- }
178
- function $3e9971be431adb24$var$FormattedDate(props) {
179
- let { value: value, formatOptions: formatOptions } = props;
180
- if (!formatOptions) formatOptions = $3e9971be431adb24$var$getDefaultFormatOptions("start" in value ? value.start : value);
181
- let dateFormatter = (0, $3xnHL$useDateFormatter)(formatOptions);
182
- let timeZone = dateFormatter.resolvedOptions().timeZone || (0, $3xnHL$getLocalTimeZone)();
183
- let final;
184
- if ("start" in value && "end" in value) {
185
- let start = value.start;
186
- let end = value.end;
187
- start = $3e9971be431adb24$var$convertDateTime(start, timeZone);
188
- end = $3e9971be431adb24$var$convertDateTime(end, timeZone);
189
- return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, dateFormatter.formatRange(start, end));
190
- }
191
- final = $3e9971be431adb24$var$convertDateTime(value, timeZone);
192
- return /*#__PURE__*/ (0, $3xnHL$react).createElement((0, $3xnHL$react).Fragment, null, dateFormatter.format(final));
193
- }
194
- function $3e9971be431adb24$var$convertDateTime(value, timeZone) {
195
- if ("timeZone" in value) return value.toDate();
196
- else if ("calendar" in value) return value.toDate(timeZone);
197
- else if (!(value instanceof Date)) return $3e9971be431adb24$var$convertValue(value).toDate(timeZone);
198
- return value;
199
- }
200
- function $3e9971be431adb24$var$getDefaultFormatOptions(value) {
201
- if (value instanceof Date) return {
202
- dateStyle: "long",
203
- timeStyle: "short"
204
- };
205
- else if ("timeZone" in value) return {
206
- year: "numeric",
207
- month: "long",
208
- day: "numeric",
209
- hour: "numeric",
210
- minute: "numeric",
211
- timeZone: value.timeZone,
212
- timeZoneName: "short"
213
- };
214
- else if ("hour" in value && "year" in value) return {
215
- dateStyle: "long",
216
- timeStyle: "short"
217
- };
218
- else if ("hour" in value) return {
219
- timeStyle: "short"
220
- };
221
- else return {
222
- dateStyle: "long"
223
- };
224
- }
225
- function $3e9971be431adb24$var$convertValue(value) {
226
- let date = (0, $3xnHL$today)((0, $3xnHL$getLocalTimeZone)());
227
- return (0, $3xnHL$toCalendarDateTime)(date, value);
228
- }
229
- /**
230
- * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
231
- */ let $3e9971be431adb24$export$d1328f67a56fa517 = /*#__PURE__*/ (0, $3xnHL$react).forwardRef($3e9971be431adb24$var$LabeledValue);
232
-
233
14
 
234
15
 
235
16
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD,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;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA5BA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA6B,CAAC,eAAe,CAAC;AAC9C,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,2CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAAgD,CAAC,kCAAkC,CAAC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OAChB,OAAO,MAAM,MAAM;SACd,IAAI,cAAc,OACvB,OAAO,MAAM,MAAM,CAAC;SACf,IAAI,CAAE,CAAA,iBAAiB,IAAG,GAC/B,OAAO,mCAAa,OAAO,MAAM,CAAC;IAGpC,OAAO;AACT;AAEA,SAAS,8CAAwB,KAAe;IAC9C,IAAI,iBAAiB,MACnB,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,cAAc,OACvB,OAAO;QAAC,MAAM;QAAW,OAAO;QAAQ,KAAK;QAAW,MAAM;QAAW,QAAQ;QAAW,UAAU,MAAM,QAAQ;QAAE,cAAc;IAAO;SACtI,IAAI,UAAU,SAAS,UAAU,OACtC,OAAO;QAAC,WAAW;QAAQ,WAAW;IAAO;SACxC,IAAI,UAAU,OACnB,OAAO;QAAC,WAAW;IAAO;SAE1B,OAAO;QAAC,WAAW;IAAM;AAE7B;AAEA,SAAS,mCAAa,KAAW;IAC/B,IAAI,OAAO,CAAA,GAAA,YAAI,EAAE,CAAA,GAAA,uBAAe;IAEhC,OAAO,CAAA,GAAA,yBAAiB,EAAE,MAAM;AAClC;AAEA;;CAEC,GACD,IAAI,0DAAgB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx","packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2022 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 type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\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 {CalendarDate, CalendarDateTime, getLocalTimeZone, Time, toCalendarDateTime, today, ZonedDateTime} from '@internationalized/date';\nimport {classNames, useDOMRef} from '@react-spectrum/utils';\nimport type {DOMProps, DOMRef, RangeValue, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps} from '@react-aria/utils';\nimport labelStyles from '@adobe/spectrum-css-temp/components/fieldlabel/vars.css';\nimport React, {ReactNode} from 'react';\nimport {useDateFormatter, useListFormatter, useNumberFormatter} from '@react-aria/i18n';\n\n// NOTE: the types here need to be synchronized with the ones in docs/types.ts, which are simpler so the documentation generator can handle them.\n\nexport interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, DOMProps {\n /** The content to display as the label. */\n label: ReactNode\n}\n\ntype NumberValue = number | RangeValue<number>;\ninterface NumberProps<T extends NumberValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport type DateTime = Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time;\ntype RangeDateTime = RangeValue<DateTime>;\ntype DateTimeValue = DateTime | RangeDateTime;\ninterface DateProps<T extends DateTimeValue> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.DateTimeFormatOptions\n}\n\ninterface StringProps<T extends string> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: never\n}\n\ninterface StringListProps<T extends string[]> {\n /** The value to display. */\n value: T,\n /** Formatting options for the value. */\n formatOptions?: Intl.ListFormatOptions\n}\n\ntype LabeledValueProps<T> =\n T extends NumberValue ? NumberProps<T> :\n T extends DateTimeValue ? DateProps<T> :\n T extends string[] ? StringListProps<T> :\n T extends string ? StringProps<T> :\n never;\n\ntype SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue<number> | RangeValue<DateTime>;\nexport type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBaseProps;\n\nfunction LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {\n let {\n value,\n formatOptions\n } = props;\n let domRef = useDOMRef(ref);\n\n let children;\n if (Array.isArray(value)) {\n children = <FormattedStringList value={value} formatOptions={formatOptions as Intl.ListFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start === 'number' && typeof value.end === 'number') {\n children = <FormattedNumber value={value as NumberValue} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && 'start' in value && typeof value.start !== 'number' && typeof value.end !== 'number') {\n children = <FormattedDate value={value as DateTimeValue} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'number') {\n children = <FormattedNumber value={value} formatOptions={formatOptions as Intl.NumberFormatOptions} />;\n }\n\n if (typeof value === 'object' && ('calendar' in value || 'hour' in value) || (value instanceof Date)) {\n children = <FormattedDate value={value} formatOptions={formatOptions as Intl.DateTimeFormatOptions} />;\n }\n\n if (typeof value === 'string') {\n children = value;\n }\n\n return (\n <Field {...props as any} wrapperProps={filterDOMProps(props as any)} ref={domRef} elementType=\"span\" wrapperClassName={classNames(labelStyles, 'spectrum-LabeledValue')}>\n <span>{children}</span>\n </Field>\n );\n}\n\nfunction FormattedStringList<T extends string[]>(props: StringListProps<T>) {\n let stringFormatter = useListFormatter(props.formatOptions);\n\n return (\n <>{stringFormatter.format(props.value)}</>\n );\n}\n\nfunction FormattedNumber<T extends NumberValue>(props: NumberProps<T>) {\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let value = props.value;\n\n if (typeof value === 'object') {\n return <>{numberFormatter.formatRange(value.start, value.end)}</>;\n }\n\n return <>{numberFormatter.format(value)}</>;\n}\n\nfunction FormattedDate<T extends DateTimeValue>(props: DateProps<T>) {\n let {value, formatOptions} = props;\n if (!formatOptions) {\n formatOptions = getDefaultFormatOptions('start' in value ? value.start : value);\n }\n\n let dateFormatter = useDateFormatter(formatOptions);\n let timeZone = dateFormatter.resolvedOptions().timeZone || getLocalTimeZone();\n let final: Date;\n\n if ('start' in value && 'end' in value) {\n let start = value.start;\n let end = value.end;\n\n start = convertDateTime(start, timeZone);\n end = convertDateTime(end, timeZone);\n\n return <>{dateFormatter.formatRange(start, end)}</>;\n }\n\n final = convertDateTime(value, timeZone);\n return <>{dateFormatter.format(final)}</>;\n}\n\nfunction convertDateTime(value: DateTime, timeZone: any) {\n if ('timeZone' in value) {\n return value.toDate();\n } else if ('calendar' in value) {\n return value.toDate(timeZone);\n } else if (!(value instanceof Date)) {\n return convertValue(value).toDate(timeZone);\n }\n\n return value;\n}\n\nfunction getDefaultFormatOptions(value: DateTime): Intl.DateTimeFormatOptions {\n if (value instanceof Date) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('timeZone' in value) {\n return {year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', timeZone: value.timeZone, timeZoneName: 'short'};\n } else if ('hour' in value && 'year' in value) {\n return {dateStyle: 'long', timeStyle: 'short'};\n } else if ('hour' in value) {\n return {timeStyle: 'short'};\n } else {\n return {dateStyle: 'long'};\n }\n}\n\nfunction convertValue(value: Time) {\n let date = today(getLocalTimeZone());\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.\n */\nlet _LabeledValue = React.forwardRef(LabeledValue);\nexport {_LabeledValue as LabeledValue};\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/labeledvalue/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 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 type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CalendarDate, CalendarDateTime, Time, ZonedDateTime } from "@internationalized/date";
2
- import { DOMProps, RangeValue, SpectrumLabelableProps, StyleProps } from "@react-types/shared";
2
+ import { DOMProps, RangeValue, SpectrumLabelableProps, StyleProps, DOMRefValue } from "@react-types/shared";
3
3
  import React, { ReactNode } from "react";
4
4
  interface LabeledValueBaseProps extends DOMProps, StyleProps, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, DOMProps {
5
5
  /** The content to display as the label. */
@@ -39,6 +39,6 @@ export type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBa
39
39
  /**
40
40
  * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
41
41
  */
42
- export let LabeledValue: React.ForwardRefExoticComponent<SpectrumLabeledValueProps<SpectrumLabeledValueTypes> & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLElement>>>;
42
+ export let LabeledValue: React.ForwardRefExoticComponent<SpectrumLabeledValueProps<SpectrumLabeledValueTypes> & React.RefAttributes<DOMRefValue<HTMLElement>>>;
43
43
 
44
44
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";;;AAuBA,+BAAuC,SAAQ,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,sBAAsB,EAAE,oBAAoB,GAAG,YAAY,CAAC,EAAE,QAAQ;IAC9I,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,mBAAmB,MAAM,GAAG,WAAW,MAAM,CAAC,CAAC;AAC/C,sBAAsB,CAAC,SAAS,WAAW;IACzC,4BAA4B;IAC5B,KAAK,EAAE,CAAC,CAAC;IACT,wCAAwC;IACxC,aAAa,CAAC,EAAE,KAAK,mBAAmB,CAAA;CACzC;AAED,gBAAuB,IAAI,GAAG,YAAY,GAAG,gBAAgB,GAAG,aAAa,GAAG,IAAI,CAAC;AACrF,qBAAqB,WAAW,QAAQ,CAAC,CAAC;AAC1C,qBAAqB,QAAQ,GAAG,aAAa,CAAC;AAC9C,oBAAoB,CAAC,SAAS,aAAa;IACzC,4BAA4B;IAC5B,KAAK,EAAE,CAAC,CAAC;IACT,wCAAwC;IACxC,aAAa,CAAC,EAAE,KAAK,qBAAqB,CAAA;CAC3C;AAED,sBAAsB,CAAC,SAAS,MAAM;IACpC,4BAA4B;IAC5B,KAAK,EAAE,CAAC,CAAC;IACT,wCAAwC;IACxC,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB;AAED,0BAA0B,CAAC,SAAS,MAAM,EAAE;IAC1C,4BAA4B;IAC5B,KAAK,EAAE,CAAC,CAAC;IACT,wCAAwC;IACxC,aAAa,CAAC,EAAE,KAAK,iBAAiB,CAAA;CACvC;AAED,uBAAuB,CAAC,IACtB,CAAC,SAAS,WAAW,GAAG,YAAY,CAAC,CAAC,GACtC,CAAC,SAAS,aAAa,GAAG,UAAU,CAAC,CAAC,GACtC,CAAC,SAAS,MAAM,EAAE,GAAG,gBAAgB,CAAC,CAAC,GACvC,CAAC,SAAS,MAAM,GAAG,YAAY,CAAC,CAAC,GACjC,KAAK,CAAC;AAER,iCAAiC,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,GAAG,gBAAgB,GAAG,aAAa,GAAG,IAAI,GAAG,MAAM,GAAG,WAAW,MAAM,CAAC,GAAG,WAAW,QAAQ,CAAC,CAAC;AACxK,sCAAsC,CAAC,IAAI,kBAAkB,CAAC,CAAC,GAAG,qBAAqB,CAAC;AAoHxF;;GAEG;AACH,OAAA,IAAI,iLAA8C,CAAC","sources":["packages/@react-spectrum/labeledvalue/src/packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx","packages/@react-spectrum/labeledvalue/src/packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2022 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 type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n"],"names":[],"version":3,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EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,GAAG,gBAAgB,GAAG,aAAa,GAAG,IAAI,GAAG,MAAM,GAAG,WAAW,MAAM,CAAC,GAAG,WAAW,QAAQ,CAAC,CAAC;AACxK,sCAAsC,CAAC,IAAI,kBAAkB,CAAC,CAAC,GAAG,qBAAqB,CAAC;AAoHxF;;GAEG;AACH,OAAA,IAAI,mJAA8C,CAAC","sources":["packages/@react-spectrum/labeledvalue/src/packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx","packages/@react-spectrum/labeledvalue/src/packages/@react-spectrum/labeledvalue/src/index.ts","packages/@react-spectrum/labeledvalue/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2022 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 type {SpectrumLabeledValueProps} from './LabeledValue';\nexport {LabeledValue} from './LabeledValue';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -268,4 +268,4 @@
268
268
  :is(.A-HlBa_spectrum-FieldLabel, .A-HlBa_spectrum-Form-itemLabel).A-HlBa_is-disabled {
269
269
  color: var(--spectrum-fieldlabel-text-color-disabled, var(--spectrum-alias-text-color-disabled));
270
270
  }
271
- /*# sourceMappingURL=main.css.map */
271
+ /*# sourceMappingURL=vars.0e5b9e64.css.map */
@@ -1 +1 @@
1
- {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;;;;;;AAsBA;;;;;;AAMA;;;;;;;AAOA;;;;;AAUA;;;;;AAIE;;;;;;AAMA;;;;;;;;;;AAUE;;;;;AAMA;;;;AAIA;;;;AAOF;;;;;AAKE;;;;;;;AAaE;;;;AAMF;;;;;AAKA;;;;;AAOA;;;;AAaF;;;;;;;;AAOE;;;;;AAME;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAGE;;;;AAMJ;;;;AAIA;;;;;AAOF;;;;;;;AASE;;;;;AASF;;;;AAGE;;;;;;AAOF;;;;AAIA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;AAkBF;;;;AAIE","sources":["packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.css.map"}
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;;;;;;;AAsBA;;;;;;AAMA;;;;;;;AAOA;;;;;AAUA;;;;;AAIE;;;;;;AAMA;;;;;;;;;;AAUE;;;;;AAMA;;;;AAIA;;;;AAOF;;;;;AAKE;;;;;;;AAaE;;;;AAMF;;;;;AAKA;;;;;AAOA;;;;AAaF;;;;;;;;AAOE;;;;;AAME;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAGE;;;;AAMJ;;;;AAIA;;;;;AAOF;;;;;;;AASE;;;;;AASF;;;;AAGE;;;;;;AAOF;;;;AAIA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;AAkBF;;;;AAIE","sources":["packages/@adobe/spectrum-css-temp/components/fieldlabel/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.0e5b9e64.css.map"}