@react-spectrum/labeledvalue 3.1.17 → 3.1.19

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2019 Adobe
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,4 +1,4 @@
1
- require("./vars.b904ab57.css");
1
+ require("./vars.6c953d9a.css");
2
2
  var $eb2fc0ee655eff6b$exports = require("./fieldlabel_vars_css.main.js");
3
3
  var $lcZyr$internationalizeddate = require("@internationalized/date");
4
4
  var $lcZyr$reactspectrumutils = require("@react-spectrum/utils");
@@ -34,7 +34,7 @@ $parcel$export(module.exports, "LabeledValue", () => $2a7417c2df2197f7$export$d1
34
34
 
35
35
 
36
36
 
37
- function $2a7417c2df2197f7$var$LabeledValue(props, ref) {
37
+ const $2a7417c2df2197f7$export$d1328f67a56fa517 = /*#__PURE__*/ (0, ($parcel$interopDefault($lcZyr$react))).forwardRef(function LabeledValue(props, ref) {
38
38
  let { value: value, formatOptions: formatOptions } = props;
39
39
  let domRef = (0, $lcZyr$reactspectrumutils.useDOMRef)(ref);
40
40
  let children;
@@ -66,7 +66,7 @@ function $2a7417c2df2197f7$var$LabeledValue(props, ref) {
66
66
  elementType: "span",
67
67
  wrapperClassName: (0, $lcZyr$reactspectrumutils.classNames)((0, ($parcel$interopDefault($eb2fc0ee655eff6b$exports))), 'spectrum-LabeledValue')
68
68
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($lcZyr$react))).createElement("span", null, children));
69
- }
69
+ });
70
70
  function $2a7417c2df2197f7$var$FormattedStringList(props) {
71
71
  let stringFormatter = (0, $lcZyr$reactariai18n.useListFormatter)(props.formatOptions);
72
72
  return /*#__PURE__*/ (0, ($parcel$interopDefault($lcZyr$react))).createElement((0, ($parcel$interopDefault($lcZyr$react))).Fragment, null, stringFormatter.format(props.value));
@@ -128,9 +128,6 @@ function $2a7417c2df2197f7$var$convertValue(value) {
128
128
  let date = (0, $lcZyr$internationalizeddate.today)((0, $lcZyr$internationalizeddate.getLocalTimeZone)());
129
129
  return (0, $lcZyr$internationalizeddate.toCalendarDateTime)(date, value);
130
130
  }
131
- /**
132
- * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
133
- */ let $2a7417c2df2197f7$export$d1328f67a56fa517 = /*#__PURE__*/ (0, ($parcel$interopDefault($lcZyr$react))).forwardRef($2a7417c2df2197f7$var$LabeledValue);
134
131
 
135
132
 
136
133
  //# sourceMappingURL=LabeledValue.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4DD,SAAS,mCAAkD,KAAmC,EAAE,GAAwB;IACtH,IAAI,SACF,KAAK,iBACL,aAAa,EACd,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,QAChB,yBAAW,0DAAC;QAAoB,OAAO;QAAO,eAAe;;IAG/D,IAAI,OAAO,UAAU,YAAY,WAAW,SAAS,OAAO,MAAM,KAAK,KAAK,YAAY,OAAO,MAAM,GAAG,KAAK,UAC3G,yBAAW,0DAAC;QAAgB,OAAO;QAAsB,eAAe;;IAG1E,IAAI,OAAO,UAAU,YAAY,WAAW,SAAS,OAAO,MAAM,KAAK,KAAK,YAAY,OAAO,MAAM,GAAG,KAAK,UAC3G,yBAAW,0DAAC;QAAc,OAAO;QAAwB,eAAe;;IAG1E,IAAI,OAAO,UAAU,UACnB,yBAAW,0DAAC;QAAgB,OAAO;QAAO,eAAe;;IAG3D,IAAI,OAAO,UAAU,YAAa,CAAA,cAAc,SAAS,UAAU,KAAI,KAAO,iBAAiB,MAC7F,yBAAW,0DAAC;QAAc,OAAO;QAAO,eAAe;;IAGzD,IAAI,OAAO,UAAU,UACnB,WAAW;IAGb,qBACE,0DAAC,CAAA,GAAA,+BAAI;QAAG,GAAG,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,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/LabeledValue.tsx"],"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\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"],"names":[],"version":3,"file":"LabeledValue.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA+DM,MAAM,0DAAe,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,aAAkD,KAAmC,EAAE,GAAwB;IACnK,IAAI,SACF,KAAK,iBACL,aAAa,EACd,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,QAChB,yBAAW,0DAAC;QAAoB,OAAO;QAAO,eAAe;;IAG/D,IAAI,OAAO,UAAU,YAAY,WAAW,SAAS,OAAO,MAA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yright 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\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 */\nexport const LabeledValue = React.forwardRef(function 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"],"names":[],"version":3,"file":"LabeledValue.main.js.map"}
@@ -1,4 +1,4 @@
1
- import "./vars.b904ab57.css";
1
+ import "./vars.6c953d9a.css";
2
2
  import $fhlTD$fieldlabel_vars_cssmodulejs from "./fieldlabel_vars_css.mjs";
3
3
  import {getLocalTimeZone as $fhlTD$getLocalTimeZone, today as $fhlTD$today, toCalendarDateTime as $fhlTD$toCalendarDateTime} from "@internationalized/date";
4
4
  import {useDOMRef as $fhlTD$useDOMRef, classNames as $fhlTD$classNames} from "@react-spectrum/utils";
@@ -28,7 +28,7 @@ function $parcel$interopDefault(a) {
28
28
 
29
29
 
30
30
 
31
- function $3e9971be431adb24$var$LabeledValue(props, ref) {
31
+ const $3e9971be431adb24$export$d1328f67a56fa517 = /*#__PURE__*/ (0, $fhlTD$react).forwardRef(function LabeledValue(props, ref) {
32
32
  let { value: value, formatOptions: formatOptions } = props;
33
33
  let domRef = (0, $fhlTD$useDOMRef)(ref);
34
34
  let children;
@@ -60,7 +60,7 @@ function $3e9971be431adb24$var$LabeledValue(props, ref) {
60
60
  elementType: "span",
61
61
  wrapperClassName: (0, $fhlTD$classNames)((0, ($parcel$interopDefault($fhlTD$fieldlabel_vars_cssmodulejs))), 'spectrum-LabeledValue')
62
62
  }, /*#__PURE__*/ (0, $fhlTD$react).createElement("span", null, children));
63
- }
63
+ });
64
64
  function $3e9971be431adb24$var$FormattedStringList(props) {
65
65
  let stringFormatter = (0, $fhlTD$useListFormatter)(props.formatOptions);
66
66
  return /*#__PURE__*/ (0, $fhlTD$react).createElement((0, $fhlTD$react).Fragment, null, stringFormatter.format(props.value));
@@ -122,9 +122,6 @@ function $3e9971be431adb24$var$convertValue(value) {
122
122
  let date = (0, $fhlTD$today)((0, $fhlTD$getLocalTimeZone)());
123
123
  return (0, $fhlTD$toCalendarDateTime)(date, value);
124
124
  }
125
- /**
126
- * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
127
- */ let $3e9971be431adb24$export$d1328f67a56fa517 = /*#__PURE__*/ (0, $fhlTD$react).forwardRef($3e9971be431adb24$var$LabeledValue);
128
125
 
129
126
 
130
127
  export {$3e9971be431adb24$export$d1328f67a56fa517 as LabeledValue};
@@ -1,4 +1,4 @@
1
- import "./vars.b904ab57.css";
1
+ import "./vars.6c953d9a.css";
2
2
  import $fhlTD$fieldlabel_vars_cssmodulejs from "./fieldlabel_vars_css.module.js";
3
3
  import {getLocalTimeZone as $fhlTD$getLocalTimeZone, today as $fhlTD$today, toCalendarDateTime as $fhlTD$toCalendarDateTime} from "@internationalized/date";
4
4
  import {useDOMRef as $fhlTD$useDOMRef, classNames as $fhlTD$classNames} from "@react-spectrum/utils";
@@ -28,7 +28,7 @@ function $parcel$interopDefault(a) {
28
28
 
29
29
 
30
30
 
31
- function $3e9971be431adb24$var$LabeledValue(props, ref) {
31
+ const $3e9971be431adb24$export$d1328f67a56fa517 = /*#__PURE__*/ (0, $fhlTD$react).forwardRef(function LabeledValue(props, ref) {
32
32
  let { value: value, formatOptions: formatOptions } = props;
33
33
  let domRef = (0, $fhlTD$useDOMRef)(ref);
34
34
  let children;
@@ -60,7 +60,7 @@ function $3e9971be431adb24$var$LabeledValue(props, ref) {
60
60
  elementType: "span",
61
61
  wrapperClassName: (0, $fhlTD$classNames)((0, ($parcel$interopDefault($fhlTD$fieldlabel_vars_cssmodulejs))), 'spectrum-LabeledValue')
62
62
  }, /*#__PURE__*/ (0, $fhlTD$react).createElement("span", null, children));
63
- }
63
+ });
64
64
  function $3e9971be431adb24$var$FormattedStringList(props) {
65
65
  let stringFormatter = (0, $fhlTD$useListFormatter)(props.formatOptions);
66
66
  return /*#__PURE__*/ (0, $fhlTD$react).createElement((0, $fhlTD$react).Fragment, null, stringFormatter.format(props.value));
@@ -122,9 +122,6 @@ function $3e9971be431adb24$var$convertValue(value) {
122
122
  let date = (0, $fhlTD$today)((0, $fhlTD$getLocalTimeZone)());
123
123
  return (0, $fhlTD$toCalendarDateTime)(date, value);
124
124
  }
125
- /**
126
- * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
127
- */ let $3e9971be431adb24$export$d1328f67a56fa517 = /*#__PURE__*/ (0, $fhlTD$react).forwardRef($3e9971be431adb24$var$LabeledValue);
128
125
 
129
126
 
130
127
  export {$3e9971be431adb24$export$d1328f67a56fa517 as LabeledValue};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4DD,SAAS,mCAAkD,KAAmC,EAAE,GAAwB;IACtH,IAAI,SACF,KAAK,iBACL,aAAa,EACd,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,QAChB,yBAAW,gCAAC;QAAoB,OAAO;QAAO,eAAe;;IAG/D,IAAI,OAAO,UAAU,YAAY,WAAW,SAAS,OAAO,MAAM,KAAK,KAAK,YAAY,OAAO,MAAM,GAAG,KAAK,UAC3G,yBAAW,gCAAC;QAAgB,OAAO;QAAsB,eAAe;;IAG1E,IAAI,OAAO,UAAU,YAAY,WAAW,SAAS,OAAO,MAAM,KAAK,KAAK,YAAY,OAAO,MAAM,GAAG,KAAK,UAC3G,yBAAW,gCAAC;QAAc,OAAO;QAAwB,eAAe;;IAG1E,IAAI,OAAO,UAAU,UACnB,yBAAW,gCAAC;QAAgB,OAAO;QAAO,eAAe;;IAG3D,IAAI,OAAO,UAAU,YAAa,CAAA,cAAc,SAAS,UAAU,KAAI,KAAO,iBAAiB,MAC7F,yBAAW,gCAAC;QAAc,OAAO;QAAO,eAAe;;IAGzD,IAAI,OAAO,UAAU,UACnB,WAAW;IAGb,qBACE,gCAAC,CAAA,GAAA,YAAI;QAAG,GAAG,KAAK;QAAS,cAAc,CAAA,GAAA,qBAAa,EAAE;QAAe,KAAK;QAAQ,aAAY;QAAO,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG;qBAC7I,gCAAC,cAAM;AAGb;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AAiB,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/LabeledValue.tsx"],"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\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"],"names":[],"version":3,"file":"LabeledValue.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA+DM,MAAM,0DAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,aAAkD,KAAmC,EAAE,GAAwB;IACnK,IAAI,SACF,KAAK,iBACL,aAAa,EACd,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI;IACJ,IAAI,MAAM,OAAO,CAAC,QAChB,yBAAW,gCAAC;QAAoB,OAAO;QAAO,eAAe;;IAG/D,IAAI,OAAO,UAAU,YAAY,WAAW,SAAS,OAAO,MAAM,KAAK,KAAK,YAAY,OAAO,MAAM,GAAG,KAAK,UAC3G,yBAAW,gCAAC;QAAgB,OAAO;QAAsB,eAAe;;IAG1E,IAAI,OAAO,UAAU,YAAY,WAAW,SAAS,OAAO,MAAM,KAAK,KAAK,YAAY,OAAO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O;QACtC,IAAI,QAAQ,MAAM,KAAK;QACvB,IAAI,MAAM,MAAM,GAAG;QAEnB,QAAQ,sCAAgB,OAAO;QAC/B,MAAM,sCAAgB,KAAK;QAE3B,qBAAO,kEAAG,cAAc,WAAW,CAAC,OAAO;IAC7C;IAEA,QAAQ,sCAAgB,OAAO;IAC/B,qBAAO,kEAAG,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,YAAI,EAAE,CAAA,GAAA,uBAAe;IAEhC,OAAO,CAAA,GAAA,yBAAiB,EAAE,MAAM;AAClC","sources":["packages/@react-spectrum/labeledvalue/src/LabeledValue.tsx"],"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\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\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 */\nexport const LabeledValue = React.forwardRef(function 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"],"names":[],"version":3,"file":"LabeledValue.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAA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E,4CAA0C,CAAC,4BAA4B,CAAC","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":"fieldlabel_vars_css.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,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;AACpF,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,2CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAqD,CAAC,uCAAuC,CAAC;AAC9F,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAkC,CAAC,oBAAoB,CAAC;AACxD,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA0C,CAAC,4BAA4B,CAAC","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":"fieldlabel_vars_css.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,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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el/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":"fieldlabel_vars_css.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,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;AACpF,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,2CAAwC,CAAC,0BAA0B,CAAC;AACpE,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAqD,CAAC,uCAAuC,CAAC;AAC9F,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAkC,CAAC,oBAAoB,CAAC;AACxD,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA0C,CAAC,4BAA4B,CAAC","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":"fieldlabel_vars_css.module.js.map"}
package/dist/types.d.ts CHANGED
@@ -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<DOMRefValue<HTMLElement>>>;
42
+ export const 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,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"}
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,4BAA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-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"}
@@ -152,9 +152,9 @@
152
152
  }
153
153
 
154
154
  .jIQVGq_spectrum-Field:where(.jIQVGq_spectrum-Field--positionSide) .jIQVGq_spectrum-Field-wrapper {
155
+ min-width: 0;
155
156
  width: var(--spectrum-field-default-width);
156
157
  flex: 1;
157
- min-width: 0;
158
158
  height: 100%;
159
159
  }
160
160
 
@@ -214,8 +214,8 @@
214
214
  }
215
215
 
216
216
  .jIQVGq_spectrum-Form.jIQVGq_spectrum-Form--positionSide .jIQVGq_spectrum-Field-field {
217
- min-width: var(--spectrum-alias-single-line-width, var(--spectrum-global-dimension-size-2400));
218
217
  width: auto;
218
+ min-width: var(--spectrum-alias-single-line-width, var(--spectrum-global-dimension-size-2400));
219
219
  }
220
220
 
221
221
  .jIQVGq_spectrum-Form.jIQVGq_spectrum-Form--positionTop {
@@ -268,4 +268,4 @@
268
268
  :is(.jIQVGq_spectrum-FieldLabel, .jIQVGq_spectrum-Form-itemLabel).jIQVGq_is-disabled {
269
269
  color: var(--spectrum-fieldlabel-text-color-disabled, var(--spectrum-alias-text-color-disabled));
270
270
  }
271
- /*# sourceMappingURL=vars.b904ab57.css.map */
271
+ /*# sourceMappingURL=vars.6c953d9a.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":"vars.b904ab57.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.6c953d9a.css.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/labeledvalue",
3
- "version": "3.1.17",
3
+ "version": "3.1.19",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,12 +36,12 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@internationalized/date": "^3.5.6",
40
- "@react-aria/i18n": "^3.12.3",
41
- "@react-aria/utils": "^3.25.3",
42
- "@react-spectrum/label": "^3.16.9",
43
- "@react-spectrum/utils": "^3.11.11",
44
- "@react-types/shared": "^3.25.0",
39
+ "@internationalized/date": "^3.7.0",
40
+ "@react-aria/i18n": "^3.12.5",
41
+ "@react-aria/utils": "^3.27.0",
42
+ "@react-spectrum/label": "^3.16.11",
43
+ "@react-spectrum/utils": "^3.12.1",
44
+ "@react-types/shared": "^3.27.0",
45
45
  "@swc/helpers": "^0.5.0"
46
46
  },
47
47
  "devDependencies": {
@@ -49,9 +49,11 @@
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@react-spectrum/provider": "^3.0.0",
52
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
52
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
53
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
53
54
  },
54
55
  "publishConfig": {
55
56
  "access": "public"
56
- }
57
- }
57
+ },
58
+ "gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
59
+ }
@@ -68,7 +68,10 @@ type LabeledValueProps<T> =
68
68
  type SpectrumLabeledValueTypes = string[] | string | Date | CalendarDate | CalendarDateTime | ZonedDateTime | Time | number | RangeValue<number> | RangeValue<DateTime>;
69
69
  export type SpectrumLabeledValueProps<T> = LabeledValueProps<T> & LabeledValueBaseProps;
70
70
 
71
- function LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {
71
+ /**
72
+ * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
73
+ */
74
+ export const LabeledValue = React.forwardRef(function LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabeledValueProps<T>, ref: DOMRef<HTMLElement>) {
72
75
  let {
73
76
  value,
74
77
  formatOptions
@@ -105,7 +108,7 @@ function LabeledValue<T extends SpectrumLabeledValueTypes>(props: SpectrumLabele
105
108
  <span>{children}</span>
106
109
  </Field>
107
110
  );
108
- }
111
+ });
109
112
 
110
113
  function FormattedStringList<T extends string[]>(props: StringListProps<T>) {
111
114
  let stringFormatter = useListFormatter(props.formatOptions);
@@ -181,9 +184,3 @@ function convertValue(value: Time) {
181
184
 
182
185
  return toCalendarDateTime(date, value);
183
186
  }
184
-
185
- /**
186
- * A LabeledValue displays a non-editable value with a label. It formats numbers, dates, times, and lists according to the user's locale.
187
- */
188
- let _LabeledValue = React.forwardRef(LabeledValue);
189
- export {_LabeledValue as LabeledValue};