@react-spectrum/picker 3.14.4-nightly.4555 → 3.14.4-nightly.4560

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.
Files changed (59) hide show
  1. package/dist/Picker.main.js +238 -0
  2. package/dist/Picker.main.js.map +1 -0
  3. package/dist/Picker.mjs +233 -0
  4. package/dist/Picker.module.js +233 -0
  5. package/dist/Picker.module.js.map +1 -0
  6. package/dist/ar-AE.mjs +1 -1
  7. package/dist/bg-BG.mjs +1 -1
  8. package/dist/cs-CZ.mjs +1 -1
  9. package/dist/da-DK.mjs +1 -1
  10. package/dist/de-DE.mjs +1 -1
  11. package/dist/dropdown_vars_css.main.js +77 -0
  12. package/dist/dropdown_vars_css.main.js.map +1 -0
  13. package/dist/dropdown_vars_css.mjs +79 -0
  14. package/dist/dropdown_vars_css.module.js +79 -0
  15. package/dist/dropdown_vars_css.module.js.map +1 -0
  16. package/dist/el-GR.mjs +1 -1
  17. package/dist/en-US.mjs +1 -1
  18. package/dist/es-ES.mjs +1 -1
  19. package/dist/et-EE.mjs +1 -1
  20. package/dist/fi-FI.mjs +1 -1
  21. package/dist/fr-FR.mjs +1 -1
  22. package/dist/he-IL.mjs +1 -1
  23. package/dist/hr-HR.mjs +1 -1
  24. package/dist/hu-HU.mjs +1 -1
  25. package/dist/import.mjs +1 -409
  26. package/dist/intlStrings.main.js +108 -0
  27. package/dist/intlStrings.main.js.map +1 -0
  28. package/dist/intlStrings.mjs +110 -0
  29. package/dist/intlStrings.module.js +110 -0
  30. package/dist/intlStrings.module.js.map +1 -0
  31. package/dist/it-IT.mjs +1 -1
  32. package/dist/ja-JP.mjs +1 -1
  33. package/dist/ko-KR.mjs +1 -1
  34. package/dist/lt-LT.mjs +1 -1
  35. package/dist/lv-LV.mjs +1 -1
  36. package/dist/main.js +2 -406
  37. package/dist/main.js.map +1 -1
  38. package/dist/module.js +1 -409
  39. package/dist/module.js.map +1 -1
  40. package/dist/nb-NO.mjs +1 -1
  41. package/dist/nl-NL.mjs +1 -1
  42. package/dist/pl-PL.mjs +1 -1
  43. package/dist/pt-BR.mjs +1 -1
  44. package/dist/pt-PT.mjs +1 -1
  45. package/dist/ro-RO.mjs +1 -1
  46. package/dist/ru-RU.mjs +1 -1
  47. package/dist/sk-SK.mjs +1 -1
  48. package/dist/sl-SI.mjs +1 -1
  49. package/dist/sr-SP.mjs +1 -1
  50. package/dist/sv-SE.mjs +1 -1
  51. package/dist/tr-TR.mjs +1 -1
  52. package/dist/uk-UA.mjs +1 -1
  53. package/dist/{main.css → vars.7b6f8dc5.css} +1 -1
  54. package/dist/{main.css.map → vars.7b6f8dc5.css.map} +1 -1
  55. package/dist/zh-CN.mjs +1 -1
  56. package/dist/zh-TW.mjs +1 -1
  57. package/package.json +20 -20
  58. package/dist/module.css +0 -288
  59. package/dist/module.css.map +0 -1
package/dist/module.js CHANGED
@@ -1,65 +1,6 @@
1
- import $d1a348ee160b1c35$exports from "./ar-AE.module.js";
2
- import $6f4b5567d8931b2c$exports from "./bg-BG.module.js";
3
- import $413f5c9b05a53d70$exports from "./cs-CZ.module.js";
4
- import $23214587b45d0c7a$exports from "./da-DK.module.js";
5
- import $291e2fb947064c57$exports from "./de-DE.module.js";
6
- import $c5247287ce725677$exports from "./el-GR.module.js";
7
- import $3d85b21727aef233$exports from "./en-US.module.js";
8
- import $573c338a19d2e44a$exports from "./es-ES.module.js";
9
- import $52537a7562a0fcd4$exports from "./et-EE.module.js";
10
- import $f128a549f8c2b170$exports from "./fi-FI.module.js";
11
- import $f69e7a23857afc72$exports from "./fr-FR.module.js";
12
- import $cf880887f8515ea2$exports from "./he-IL.module.js";
13
- import $1f679bbb79879af2$exports from "./hr-HR.module.js";
14
- import $fc9bc2ec180ca71d$exports from "./hu-HU.module.js";
15
- import $9fbc1ff7e87407ac$exports from "./it-IT.module.js";
16
- import $96673b78dbaf44b6$exports from "./ja-JP.module.js";
17
- import $beddb5ded972a868$exports from "./ko-KR.module.js";
18
- import $2ac19a654f19cde2$exports from "./lt-LT.module.js";
19
- import $844be78af2d57459$exports from "./lv-LV.module.js";
20
- import $42b05097f4e27f73$exports from "./nb-NO.module.js";
21
- import $74dd3f417665b06f$exports from "./nl-NL.module.js";
22
- import $6221651ca0306be3$exports from "./pl-PL.module.js";
23
- import $45bd58553e21ec53$exports from "./pt-BR.module.js";
24
- import $7ae7985d84009e3a$exports from "./pt-PT.module.js";
25
- import $c83f9725f6024f47$exports from "./ro-RO.module.js";
26
- import $0fb522ae7b51fefd$exports from "./ru-RU.module.js";
27
- import $5ca94db2a021a726$exports from "./sk-SK.module.js";
28
- import $2c7a753ed24e9851$exports from "./sl-SI.module.js";
29
- import $14a1d1750c9de591$exports from "./sr-SP.module.js";
30
- import $bf3f89a84488b301$exports from "./sv-SE.module.js";
31
- import $1ff90abddf42fc72$exports from "./tr-TR.module.js";
32
- import $4f07d8c17926a679$exports from "./uk-UA.module.js";
33
- import $07a8d3b903fa886f$exports from "./zh-CN.module.js";
34
- import $e1416a5539091e36$exports from "./zh-TW.module.js";
35
- import "./module.css";
1
+ import {Picker as $51664a9007a3c6f9$export$ba25329847403e11} from "./Picker.module.js";
36
2
  import {Item as $23896c8062ba3967$re_export$Item, Section as $23896c8062ba3967$re_export$Section} from "@react-stately/collections";
37
- import $3toCD$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
38
- import $3toCD$spectrumiconsuiChevronDownMedium from "@spectrum-icons/ui/ChevronDownMedium";
39
- import {useSlotProps as $3toCD$useSlotProps, useDOMRef as $3toCD$useDOMRef, useUnwrapDOMRef as $3toCD$useUnwrapDOMRef, useIsMobileDevice as $3toCD$useIsMobileDevice, dimensionValue as $3toCD$dimensionValue, classNames as $3toCD$classNames, SlotProvider as $3toCD$SlotProvider} from "@react-spectrum/utils";
40
- import {Field as $3toCD$Field} from "@react-spectrum/label";
41
- import {FieldButton as $3toCD$FieldButton} from "@react-spectrum/button";
42
- import {useSelect as $3toCD$useSelect, HiddenSelect as $3toCD$HiddenSelect} from "@react-aria/select";
43
- import {useListBoxLayout as $3toCD$useListBoxLayout, ListBoxBase as $3toCD$ListBoxBase} from "@react-spectrum/listbox";
44
- import {useId as $3toCD$useId, useResizeObserver as $3toCD$useResizeObserver, useLayoutEffect as $3toCD$useLayoutEffect, mergeProps as $3toCD$mergeProps} from "@react-aria/utils";
45
- import {Tray as $3toCD$Tray, Popover as $3toCD$Popover} from "@react-spectrum/overlays";
46
- import {useHover as $3toCD$useHover, PressResponder as $3toCD$PressResponder} from "@react-aria/interactions";
47
- import {ProgressCircle as $3toCD$ProgressCircle} from "@react-spectrum/progress";
48
- import $3toCD$react, {useRef as $3toCD$useRef, useState as $3toCD$useState, useCallback as $3toCD$useCallback} from "react";
49
- import {Text as $3toCD$Text} from "@react-spectrum/text";
50
- import {useFormProps as $3toCD$useFormProps} from "@react-spectrum/form";
51
- import {useLocalizedStringFormatter as $3toCD$useLocalizedStringFormatter} from "@react-aria/i18n";
52
- import {useProviderProps as $3toCD$useProviderProps, useProvider as $3toCD$useProvider} from "@react-spectrum/provider";
53
- import {useSelectState as $3toCD$useSelectState} from "@react-stately/select";
54
3
 
55
-
56
- function $parcel$interopDefault(a) {
57
- return a && a.__esModule ? a.default : a;
58
- }
59
-
60
- function $parcel$export(e, n, v, s) {
61
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
62
- }
63
4
  /*
64
5
  * Copyright 2020 Adobe. All rights reserved.
65
6
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -71,355 +12,6 @@ function $parcel$export(e, n, v, s) {
71
12
  * OF ANY KIND, either express or implied. See the License for the specific language
72
13
  * governing permissions and limitations under the License.
73
14
  */ /// <reference types="css-module-types" />
74
- /*
75
- * Copyright 2020 Adobe. All rights reserved.
76
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
77
- * you may not use this file except in compliance with the License. You may obtain a copy
78
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
79
- *
80
- * Unless required by applicable law or agreed to in writing, software distributed under
81
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
82
- * OF ANY KIND, either express or implied. See the License for the specific language
83
- * governing permissions and limitations under the License.
84
- */
85
-
86
-
87
-
88
-
89
-
90
- var $45fc5064af81e0a8$exports = {};
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
- $45fc5064af81e0a8$exports = {
126
- "ar-AE": $d1a348ee160b1c35$exports,
127
- "bg-BG": $6f4b5567d8931b2c$exports,
128
- "cs-CZ": $413f5c9b05a53d70$exports,
129
- "da-DK": $23214587b45d0c7a$exports,
130
- "de-DE": $291e2fb947064c57$exports,
131
- "el-GR": $c5247287ce725677$exports,
132
- "en-US": $3d85b21727aef233$exports,
133
- "es-ES": $573c338a19d2e44a$exports,
134
- "et-EE": $52537a7562a0fcd4$exports,
135
- "fi-FI": $f128a549f8c2b170$exports,
136
- "fr-FR": $f69e7a23857afc72$exports,
137
- "he-IL": $cf880887f8515ea2$exports,
138
- "hr-HR": $1f679bbb79879af2$exports,
139
- "hu-HU": $fc9bc2ec180ca71d$exports,
140
- "it-IT": $9fbc1ff7e87407ac$exports,
141
- "ja-JP": $96673b78dbaf44b6$exports,
142
- "ko-KR": $beddb5ded972a868$exports,
143
- "lt-LT": $2ac19a654f19cde2$exports,
144
- "lv-LV": $844be78af2d57459$exports,
145
- "nb-NO": $42b05097f4e27f73$exports,
146
- "nl-NL": $74dd3f417665b06f$exports,
147
- "pl-PL": $6221651ca0306be3$exports,
148
- "pt-BR": $45bd58553e21ec53$exports,
149
- "pt-PT": $7ae7985d84009e3a$exports,
150
- "ro-RO": $c83f9725f6024f47$exports,
151
- "ru-RU": $0fb522ae7b51fefd$exports,
152
- "sk-SK": $5ca94db2a021a726$exports,
153
- "sl-SI": $2c7a753ed24e9851$exports,
154
- "sr-SP": $14a1d1750c9de591$exports,
155
- "sv-SE": $bf3f89a84488b301$exports,
156
- "tr-TR": $1ff90abddf42fc72$exports,
157
- "uk-UA": $4f07d8c17926a679$exports,
158
- "zh-CN": $07a8d3b903fa886f$exports,
159
- "zh-TW": $e1416a5539091e36$exports
160
- };
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
- var $3c14925a8a65017e$exports = {};
170
-
171
- $parcel$export($3c14925a8a65017e$exports, "focus-ring", () => $3c14925a8a65017e$export$f39a09f249340e2a, (v) => $3c14925a8a65017e$export$f39a09f249340e2a = v);
172
- $parcel$export($3c14925a8a65017e$exports, "i18nFontFamily", () => $3c14925a8a65017e$export$8c4ee2c50c22c514, (v) => $3c14925a8a65017e$export$8c4ee2c50c22c514 = v);
173
- $parcel$export($3c14925a8a65017e$exports, "is-disabled", () => $3c14925a8a65017e$export$d35bc1e505d1ebbf, (v) => $3c14925a8a65017e$export$d35bc1e505d1ebbf = v);
174
- $parcel$export($3c14925a8a65017e$exports, "is-hovered", () => $3c14925a8a65017e$export$b8813cd5d7824ce7, (v) => $3c14925a8a65017e$export$b8813cd5d7824ce7 = v);
175
- $parcel$export($3c14925a8a65017e$exports, "is-invalid", () => $3c14925a8a65017e$export$14a30de2866685fa, (v) => $3c14925a8a65017e$export$14a30de2866685fa = v);
176
- $parcel$export($3c14925a8a65017e$exports, "is-placeholder", () => $3c14925a8a65017e$export$e5b2f5233e4e5194, (v) => $3c14925a8a65017e$export$e5b2f5233e4e5194 = v);
177
- $parcel$export($3c14925a8a65017e$exports, "is-selected", () => $3c14925a8a65017e$export$1e0fb04f31d3c22a, (v) => $3c14925a8a65017e$export$1e0fb04f31d3c22a = v);
178
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown", () => $3c14925a8a65017e$export$f33c6833ddc773bd, (v) => $3c14925a8a65017e$export$f33c6833ddc773bd = v);
179
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown--quiet", () => $3c14925a8a65017e$export$b2306417a70c7a62, (v) => $3c14925a8a65017e$export$b2306417a70c7a62 = v);
180
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-avatar", () => $3c14925a8a65017e$export$f8e5a201376aedb0, (v) => $3c14925a8a65017e$export$f8e5a201376aedb0 = v);
181
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-chevron", () => $3c14925a8a65017e$export$abbb0cf96dbbb8a0, (v) => $3c14925a8a65017e$export$abbb0cf96dbbb8a0 = v);
182
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-fieldWrapper--positionSide", () => $3c14925a8a65017e$export$c0b4e9596538c7b1, (v) => $3c14925a8a65017e$export$c0b4e9596538c7b1 = v);
183
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-fieldWrapper--quiet", () => $3c14925a8a65017e$export$66ddc2410b0e9eba, (v) => $3c14925a8a65017e$export$66ddc2410b0e9eba = v);
184
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-invalidIcon", () => $3c14925a8a65017e$export$a32fdb5a063ea755, (v) => $3c14925a8a65017e$export$a32fdb5a063ea755 = v);
185
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-label", () => $3c14925a8a65017e$export$1235a00795b885e7, (v) => $3c14925a8a65017e$export$1235a00795b885e7 = v);
186
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-popover--quiet", () => $3c14925a8a65017e$export$cbeaf986973c0633, (v) => $3c14925a8a65017e$export$cbeaf986973c0633 = v);
187
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-progressCircle", () => $3c14925a8a65017e$export$18281c34cabbd13f, (v) => $3c14925a8a65017e$export$18281c34cabbd13f = v);
188
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Dropdown-trigger", () => $3c14925a8a65017e$export$37a6d27a7cb47ce5, (v) => $3c14925a8a65017e$export$37a6d27a7cb47ce5 = v);
189
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Field", () => $3c14925a8a65017e$export$f6d480ae1e56eba0, (v) => $3c14925a8a65017e$export$f6d480ae1e56eba0 = v);
190
- $parcel$export($3c14925a8a65017e$exports, "spectrum-FocusRing-ring", () => $3c14925a8a65017e$export$4109102f950813a6, (v) => $3c14925a8a65017e$export$4109102f950813a6 = v);
191
- $parcel$export($3c14925a8a65017e$exports, "spectrum-FocusRing", () => $3c14925a8a65017e$export$24c7f46a6e3605dd, (v) => $3c14925a8a65017e$export$24c7f46a6e3605dd = v);
192
- $parcel$export($3c14925a8a65017e$exports, "spectrum-FocusRing--quiet", () => $3c14925a8a65017e$export$2927016961429360, (v) => $3c14925a8a65017e$export$2927016961429360 = v);
193
- $parcel$export($3c14925a8a65017e$exports, "spectrum-Icon", () => $3c14925a8a65017e$export$d374b04f30360026, (v) => $3c14925a8a65017e$export$d374b04f30360026 = v);
194
- var $3c14925a8a65017e$export$f39a09f249340e2a;
195
- var $3c14925a8a65017e$export$8c4ee2c50c22c514;
196
- var $3c14925a8a65017e$export$d35bc1e505d1ebbf;
197
- var $3c14925a8a65017e$export$b8813cd5d7824ce7;
198
- var $3c14925a8a65017e$export$14a30de2866685fa;
199
- var $3c14925a8a65017e$export$e5b2f5233e4e5194;
200
- var $3c14925a8a65017e$export$1e0fb04f31d3c22a;
201
- var $3c14925a8a65017e$export$f33c6833ddc773bd;
202
- var $3c14925a8a65017e$export$b2306417a70c7a62;
203
- var $3c14925a8a65017e$export$f8e5a201376aedb0;
204
- var $3c14925a8a65017e$export$abbb0cf96dbbb8a0;
205
- var $3c14925a8a65017e$export$c0b4e9596538c7b1;
206
- var $3c14925a8a65017e$export$66ddc2410b0e9eba;
207
- var $3c14925a8a65017e$export$a32fdb5a063ea755;
208
- var $3c14925a8a65017e$export$1235a00795b885e7;
209
- var $3c14925a8a65017e$export$cbeaf986973c0633;
210
- var $3c14925a8a65017e$export$18281c34cabbd13f;
211
- var $3c14925a8a65017e$export$37a6d27a7cb47ce5;
212
- var $3c14925a8a65017e$export$f6d480ae1e56eba0;
213
- var $3c14925a8a65017e$export$4109102f950813a6;
214
- var $3c14925a8a65017e$export$24c7f46a6e3605dd;
215
- var $3c14925a8a65017e$export$2927016961429360;
216
- var $3c14925a8a65017e$export$d374b04f30360026;
217
- $3c14925a8a65017e$export$f39a09f249340e2a = `PBsjDW_focus-ring`;
218
- $3c14925a8a65017e$export$8c4ee2c50c22c514 = `PBsjDW_i18nFontFamily`;
219
- $3c14925a8a65017e$export$d35bc1e505d1ebbf = `PBsjDW_is-disabled`;
220
- $3c14925a8a65017e$export$b8813cd5d7824ce7 = `PBsjDW_is-hovered`;
221
- $3c14925a8a65017e$export$14a30de2866685fa = `PBsjDW_is-invalid`;
222
- $3c14925a8a65017e$export$e5b2f5233e4e5194 = `PBsjDW_is-placeholder`;
223
- $3c14925a8a65017e$export$1e0fb04f31d3c22a = `PBsjDW_is-selected`;
224
- $3c14925a8a65017e$export$f33c6833ddc773bd = `PBsjDW_spectrum-Dropdown`;
225
- $3c14925a8a65017e$export$b2306417a70c7a62 = `PBsjDW_spectrum-Dropdown--quiet`;
226
- $3c14925a8a65017e$export$f8e5a201376aedb0 = `PBsjDW_spectrum-Dropdown-avatar`;
227
- $3c14925a8a65017e$export$abbb0cf96dbbb8a0 = `PBsjDW_spectrum-Dropdown-chevron`;
228
- $3c14925a8a65017e$export$c0b4e9596538c7b1 = `PBsjDW_spectrum-Dropdown-fieldWrapper--positionSide`;
229
- $3c14925a8a65017e$export$66ddc2410b0e9eba = `PBsjDW_spectrum-Dropdown-fieldWrapper--quiet`;
230
- $3c14925a8a65017e$export$a32fdb5a063ea755 = `PBsjDW_spectrum-Dropdown-invalidIcon`;
231
- $3c14925a8a65017e$export$1235a00795b885e7 = `PBsjDW_spectrum-Dropdown-label`;
232
- $3c14925a8a65017e$export$cbeaf986973c0633 = `PBsjDW_spectrum-Dropdown-popover--quiet`;
233
- $3c14925a8a65017e$export$18281c34cabbd13f = `PBsjDW_spectrum-Dropdown-progressCircle`;
234
- $3c14925a8a65017e$export$37a6d27a7cb47ce5 = `PBsjDW_spectrum-Dropdown-trigger`;
235
- $3c14925a8a65017e$export$f6d480ae1e56eba0 = `PBsjDW_spectrum-Field`;
236
- $3c14925a8a65017e$export$4109102f950813a6 = `PBsjDW_spectrum-FocusRing-ring`;
237
- $3c14925a8a65017e$export$24c7f46a6e3605dd = `PBsjDW_spectrum-FocusRing ${$3c14925a8a65017e$export$4109102f950813a6}`;
238
- $3c14925a8a65017e$export$2927016961429360 = `PBsjDW_spectrum-FocusRing--quiet`;
239
- $3c14925a8a65017e$export$d374b04f30360026 = `PBsjDW_spectrum-Icon`;
240
-
241
-
242
-
243
-
244
-
245
-
246
-
247
- function $51664a9007a3c6f9$var$Picker(props, ref) {
248
- props = (0, $3toCD$useSlotProps)(props, "picker");
249
- props = (0, $3toCD$useProviderProps)(props);
250
- props = (0, $3toCD$useFormProps)(props);
251
- let stringFormatter = (0, $3toCD$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($45fc5064af81e0a8$exports))), "@react-spectrum/picker");
252
- let { autoComplete: autoComplete, isDisabled: isDisabled, direction: direction = "bottom", align: align = "start", shouldFlip: shouldFlip = true, placeholder: placeholder = stringFormatter.format("placeholder"), isQuiet: isQuiet, label: label, labelPosition: labelPosition = "top", menuWidth: menuWidth, name: name, autoFocus: autoFocus } = props;
253
- let state = (0, $3toCD$useSelectState)(props);
254
- let domRef = (0, $3toCD$useDOMRef)(ref);
255
- let popoverRef = (0, $3toCD$useRef)();
256
- let triggerRef = (0, $3toCD$useRef)();
257
- let unwrappedTriggerRef = (0, $3toCD$useUnwrapDOMRef)(triggerRef);
258
- let listboxRef = (0, $3toCD$useRef)();
259
- let isLoadingInitial = props.isLoading && state.collection.size === 0;
260
- let isLoadingMore = props.isLoading && state.collection.size > 0;
261
- let progressCircleId = (0, $3toCD$useId)();
262
- // We create the listbox layout in Picker and pass it to ListBoxBase below
263
- // so that the layout information can be cached even while the listbox is not mounted.
264
- // We also use the layout as the keyboard delegate for type to select.
265
- let layout = (0, $3toCD$useListBoxLayout)(state, isLoadingMore);
266
- let { labelProps: labelProps, triggerProps: triggerProps, valueProps: valueProps, menuProps: menuProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $3toCD$useSelect)({
267
- ...props,
268
- "aria-describedby": isLoadingInitial ? progressCircleId : undefined,
269
- keyboardDelegate: layout
270
- }, state, unwrappedTriggerRef);
271
- let isMobile = (0, $3toCD$useIsMobileDevice)();
272
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3toCD$useHover)({
273
- isDisabled: isDisabled
274
- });
275
- // On small screen devices, the listbox is rendered in a tray, otherwise a popover.
276
- let listbox = /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$ListBoxBase), {
277
- ...menuProps,
278
- ref: listboxRef,
279
- disallowEmptySelection: true,
280
- autoFocus: state.focusStrategy || true,
281
- shouldSelectOnPressUp: true,
282
- focusOnPointerEnter: true,
283
- layout: layout,
284
- state: state,
285
- width: isMobile ? "100%" : undefined,
286
- // Set max height: inherit so Tray scrolling works
287
- UNSAFE_style: {
288
- maxHeight: "inherit"
289
- },
290
- isLoading: props.isLoading,
291
- onLoadMore: props.onLoadMore
292
- });
293
- // Measure the width of the button to inform the width of the menu (below).
294
- let [buttonWidth, setButtonWidth] = (0, $3toCD$useState)(null);
295
- let { scale: scale } = (0, $3toCD$useProvider)();
296
- let onResize = (0, $3toCD$useCallback)(()=>{
297
- if (!isMobile && unwrappedTriggerRef.current) {
298
- let width = unwrappedTriggerRef.current.offsetWidth;
299
- setButtonWidth(width);
300
- }
301
- }, [
302
- unwrappedTriggerRef,
303
- setButtonWidth,
304
- isMobile
305
- ]);
306
- (0, $3toCD$useResizeObserver)({
307
- ref: unwrappedTriggerRef,
308
- onResize: onResize
309
- });
310
- (0, $3toCD$useLayoutEffect)(onResize, [
311
- scale,
312
- state.selectedKey,
313
- onResize
314
- ]);
315
- let overlay;
316
- if (isMobile) overlay = /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$Tray), {
317
- state: state
318
- }, listbox);
319
- else {
320
- // If quiet, use the default width, otherwise match the width of the button. This can be overridden by the menuWidth prop.
321
- // Always have a minimum width of the button width. When quiet, there is an extra offset to add.
322
- // Not using style props for this because they don't support `calc`.
323
- let width = isQuiet ? null : buttonWidth;
324
- let style = {
325
- width: menuWidth ? (0, $3toCD$dimensionValue)(menuWidth) : width,
326
- minWidth: isQuiet ? `calc(${buttonWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : buttonWidth
327
- };
328
- overlay = /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$Popover), {
329
- UNSAFE_style: style,
330
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown-popover", {
331
- "spectrum-Dropdown-popover--quiet": isQuiet
332
- }),
333
- ref: popoverRef,
334
- placement: `${direction} ${align}`,
335
- shouldFlip: shouldFlip,
336
- hideArrow: true,
337
- state: state,
338
- triggerRef: unwrappedTriggerRef,
339
- scrollRef: listboxRef
340
- }, listbox);
341
- }
342
- let contents = state.selectedItem ? state.selectedItem.rendered : placeholder;
343
- if (typeof contents === "string") contents = /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$Text), null, contents);
344
- let picker = /*#__PURE__*/ (0, $3toCD$react).createElement("div", {
345
- className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown", {
346
- "is-invalid": isInvalid && !isDisabled,
347
- "is-disabled": isDisabled,
348
- "spectrum-Dropdown--quiet": isQuiet
349
- })
350
- }, /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$HiddenSelect), {
351
- autoComplete: autoComplete,
352
- isDisabled: isDisabled,
353
- state: state,
354
- triggerRef: unwrappedTriggerRef,
355
- label: label,
356
- name: name
357
- }), /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$PressResponder), (0, $3toCD$mergeProps)(hoverProps, triggerProps), /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$FieldButton), {
358
- ref: triggerRef,
359
- isActive: state.isOpen,
360
- isQuiet: isQuiet,
361
- isDisabled: isDisabled,
362
- isInvalid: isInvalid,
363
- autoFocus: autoFocus,
364
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown-trigger", {
365
- "is-hovered": isHovered
366
- })
367
- }, /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$SlotProvider), {
368
- slots: {
369
- icon: {
370
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Icon"),
371
- size: "S"
372
- },
373
- avatar: {
374
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown-avatar"),
375
- size: "avatar-size-100"
376
- },
377
- text: {
378
- ...valueProps,
379
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown-label", {
380
- "is-placeholder": !state.selectedItem
381
- })
382
- },
383
- description: {
384
- isHidden: true
385
- }
386
- }
387
- }, contents), isLoadingInitial && /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$ProgressCircle), {
388
- id: progressCircleId,
389
- isIndeterminate: true,
390
- size: "S",
391
- "aria-label": stringFormatter.format("loading"),
392
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown-progressCircle")
393
- }), isInvalid && !isLoadingInitial && !isDisabled && /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$spectrumiconsuiAlertMedium), {
394
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown-invalidIcon")
395
- }), /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$spectrumiconsuiChevronDownMedium), {
396
- UNSAFE_className: (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Dropdown-chevron")
397
- }))), state.collection.size === 0 ? null : overlay);
398
- let wrapperClassName = (0, $3toCD$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3c14925a8a65017e$exports))), "spectrum-Field", {
399
- "spectrum-Dropdown-fieldWrapper--quiet": isQuiet,
400
- "spectrum-Dropdown-fieldWrapper--positionSide": labelPosition === "side"
401
- });
402
- return /*#__PURE__*/ (0, $3toCD$react).createElement((0, $3toCD$Field), {
403
- ...props,
404
- ref: domRef,
405
- wrapperClassName: wrapperClassName,
406
- labelProps: labelProps,
407
- descriptionProps: descriptionProps,
408
- errorMessageProps: errorMessageProps,
409
- isInvalid: isInvalid,
410
- validationErrors: validationErrors,
411
- validationDetails: validationDetails,
412
- showErrorIcon: false,
413
- includeNecessityIndicatorInAccessibilityName: true,
414
- elementType: "span"
415
- }, picker);
416
- }
417
- /**
418
- * Pickers allow users to choose a single option from a collapsible list of options when space is limited.
419
- */ // forwardRef doesn't support generic parameters, so cast the result to the correct type
420
- // https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref
421
- const $51664a9007a3c6f9$export$ba25329847403e11 = /*#__PURE__*/ (0, $3toCD$react).forwardRef($51664a9007a3c6f9$var$Picker);
422
-
423
15
 
424
16
 
425
17
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;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AA,YAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/picker/src/index.ts","packages/@react-spectrum/picker/src/Picker.tsx","packages/@react-spectrum/picker/src/*.js","packages/@adobe/spectrum-css-temp/components/dropdown/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Picker} from './Picker';\nexport {Item, Section} from '@react-stately/collections';\nexport type {SpectrumPickerProps} from '@react-types/select';\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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport ChevronDownMedium from '@spectrum-icons/ui/ChevronDownMedium';\nimport {\n classNames,\n dimensionValue,\n SlotProvider,\n useDOMRef,\n useIsMobileDevice,\n useSlotProps,\n useUnwrapDOMRef\n} from '@react-spectrum/utils';\nimport {DOMRef, DOMRefValue, FocusableRefValue, LabelPosition} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {HiddenSelect, useSelect} from '@react-aria/select';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport {mergeProps, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport {Popover, Tray} from '@react-spectrum/overlays';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ReactElement, useCallback, useRef, useState} from 'react';\nimport {SpectrumPickerProps} from '@react-types/select';\nimport styles from '@adobe/spectrum-css-temp/components/dropdown/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\nimport {useSelectState} from '@react-stately/select';\n\nfunction Picker<T extends object>(props: SpectrumPickerProps<T>, ref: DOMRef<HTMLDivElement>) {\n props = useSlotProps(props, 'picker');\n props = useProviderProps(props);\n props = useFormProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/picker');\n let {\n autoComplete,\n isDisabled,\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n placeholder = stringFormatter.format('placeholder'),\n isQuiet,\n label,\n labelPosition = 'top' as LabelPosition,\n menuWidth,\n name,\n autoFocus\n } = props;\n\n let state = useSelectState(props);\n let domRef = useDOMRef(ref);\n\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>();\n let triggerRef = useRef<FocusableRefValue<HTMLElement>>();\n let unwrappedTriggerRef = useUnwrapDOMRef(triggerRef);\n let listboxRef = useRef();\n\n let isLoadingInitial = props.isLoading && state.collection.size === 0;\n let isLoadingMore = props.isLoading && state.collection.size > 0;\n let progressCircleId = useId();\n\n // We create the listbox layout in Picker and pass it to ListBoxBase below\n // so that the layout information can be cached even while the listbox is not mounted.\n // We also use the layout as the keyboard delegate for type to select.\n let layout = useListBoxLayout(state, isLoadingMore);\n let {labelProps, triggerProps, valueProps, menuProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useSelect({\n ...props,\n 'aria-describedby': (isLoadingInitial ? progressCircleId : undefined),\n keyboardDelegate: layout\n }, state, unwrappedTriggerRef);\n\n let isMobile = useIsMobileDevice();\n let {hoverProps, isHovered} = useHover({isDisabled});\n\n // On small screen devices, the listbox is rendered in a tray, otherwise a popover.\n let listbox = (\n <ListBoxBase\n {...menuProps}\n ref={listboxRef}\n disallowEmptySelection\n autoFocus={state.focusStrategy || true}\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n width={isMobile ? '100%' : undefined}\n // Set max height: inherit so Tray scrolling works\n UNSAFE_style={{maxHeight: 'inherit'}}\n isLoading={props.isLoading}\n onLoadMore={props.onLoadMore} />\n );\n\n // Measure the width of the button to inform the width of the menu (below).\n let [buttonWidth, setButtonWidth] = useState(null);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (!isMobile && unwrappedTriggerRef.current) {\n let width = unwrappedTriggerRef.current.offsetWidth;\n setButtonWidth(width);\n }\n }, [unwrappedTriggerRef, setButtonWidth, isMobile]);\n\n useResizeObserver({\n ref: unwrappedTriggerRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, state.selectedKey, onResize]);\n\n let overlay;\n if (isMobile) {\n overlay = (\n <Tray state={state}>\n {listbox}\n </Tray>\n );\n } else {\n // If quiet, use the default width, otherwise match the width of the button. This can be overridden by the menuWidth prop.\n // Always have a minimum width of the button width. When quiet, there is an extra offset to add.\n // Not using style props for this because they don't support `calc`.\n let width = isQuiet ? null : buttonWidth;\n let style = {\n width: menuWidth ? dimensionValue(menuWidth) : width,\n minWidth: isQuiet ? `calc(${buttonWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : buttonWidth\n };\n\n overlay = (\n <Popover\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-Dropdown-popover', {'spectrum-Dropdown-popover--quiet': isQuiet})}\n ref={popoverRef}\n placement={`${direction} ${align}`}\n shouldFlip={shouldFlip}\n hideArrow\n state={state}\n triggerRef={unwrappedTriggerRef}\n scrollRef={listboxRef}>\n {listbox}\n </Popover>\n );\n }\n\n let contents = state.selectedItem ? state.selectedItem.rendered : placeholder;\n if (typeof contents === 'string') {\n contents = <Text>{contents}</Text>;\n }\n\n let picker = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Dropdown',\n {\n 'is-invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'spectrum-Dropdown--quiet': isQuiet\n }\n )\n }>\n <HiddenSelect\n autoComplete={autoComplete}\n isDisabled={isDisabled}\n state={state}\n triggerRef={unwrappedTriggerRef}\n label={label}\n name={name} />\n <PressResponder {...mergeProps(hoverProps, triggerProps)}>\n <FieldButton\n ref={triggerRef}\n isActive={state.isOpen}\n isQuiet={isQuiet}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n autoFocus={autoFocus}\n UNSAFE_className={classNames(styles, 'spectrum-Dropdown-trigger', {'is-hovered': isHovered})}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Icon'), size: 'S'},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Dropdown-avatar'), size: 'avatar-size-100'},\n text: {\n ...valueProps,\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Dropdown-label',\n {'is-placeholder': !state.selectedItem}\n )\n },\n description: {\n isHidden: true\n }\n }}>\n {contents}\n </SlotProvider>\n {isLoadingInitial &&\n <ProgressCircle\n id={progressCircleId}\n isIndeterminate\n size=\"S\"\n aria-label={stringFormatter.format('loading')}\n UNSAFE_className={classNames(styles, 'spectrum-Dropdown-progressCircle')} />\n }\n {isInvalid && !isLoadingInitial && !isDisabled &&\n <AlertMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-invalidIcon')} />\n }\n <ChevronDownMedium UNSAFE_className={classNames(styles, 'spectrum-Dropdown-chevron')} />\n </FieldButton>\n </PressResponder>\n {state.collection.size === 0 ? null : overlay}\n </div>\n );\n\n let wrapperClassName = classNames(\n styles,\n 'spectrum-Field',\n {\n 'spectrum-Dropdown-fieldWrapper--quiet': isQuiet,\n 'spectrum-Dropdown-fieldWrapper--positionSide': labelPosition === 'side'\n }\n );\n\n return (\n <Field\n {...props}\n ref={domRef}\n wrapperClassName={wrapperClassName}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n showErrorIcon={false}\n includeNecessityIndicatorInAccessibilityName\n elementType=\"span\">\n {picker}\n </Field>\n );\n}\n\n/**\n * Pickers allow users to choose a single option from a collapsible list of options when space is limited.\n */\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\n// https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref\nconst _Picker = React.forwardRef(Picker) as <T>(props: SpectrumPickerProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_Picker as Picker};\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\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/picker/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Picker} from './Picker';\nexport {Item, Section} from '@react-stately/collections';\nexport type {SpectrumPickerProps} from '@react-types/select';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/nb-NO.mjs CHANGED
@@ -6,4 +6,4 @@ $42b05097f4e27f73$exports = {
6
6
 
7
7
 
8
8
  export {$42b05097f4e27f73$exports as default};
9
- //# sourceMappingURL=nb-NO.module.js.map
9
+ //# sourceMappingURL=nb-NO.mjs.map
package/dist/nl-NL.mjs CHANGED
@@ -6,4 +6,4 @@ $74dd3f417665b06f$exports = {
6
6
 
7
7
 
8
8
  export {$74dd3f417665b06f$exports as default};
9
- //# sourceMappingURL=nl-NL.module.js.map
9
+ //# sourceMappingURL=nl-NL.mjs.map
package/dist/pl-PL.mjs CHANGED
@@ -6,4 +6,4 @@ $6221651ca0306be3$exports = {
6
6
 
7
7
 
8
8
  export {$6221651ca0306be3$exports as default};
9
- //# sourceMappingURL=pl-PL.module.js.map
9
+ //# sourceMappingURL=pl-PL.mjs.map
package/dist/pt-BR.mjs CHANGED
@@ -6,4 +6,4 @@ $45bd58553e21ec53$exports = {
6
6
 
7
7
 
8
8
  export {$45bd58553e21ec53$exports as default};
9
- //# sourceMappingURL=pt-BR.module.js.map
9
+ //# sourceMappingURL=pt-BR.mjs.map
package/dist/pt-PT.mjs CHANGED
@@ -6,4 +6,4 @@ $7ae7985d84009e3a$exports = {
6
6
 
7
7
 
8
8
  export {$7ae7985d84009e3a$exports as default};
9
- //# sourceMappingURL=pt-PT.module.js.map
9
+ //# sourceMappingURL=pt-PT.mjs.map
package/dist/ro-RO.mjs CHANGED
@@ -6,4 +6,4 @@ $c83f9725f6024f47$exports = {
6
6
 
7
7
 
8
8
  export {$c83f9725f6024f47$exports as default};
9
- //# sourceMappingURL=ro-RO.module.js.map
9
+ //# sourceMappingURL=ro-RO.mjs.map
package/dist/ru-RU.mjs CHANGED
@@ -6,4 +6,4 @@ $0fb522ae7b51fefd$exports = {
6
6
 
7
7
 
8
8
  export {$0fb522ae7b51fefd$exports as default};
9
- //# sourceMappingURL=ru-RU.module.js.map
9
+ //# sourceMappingURL=ru-RU.mjs.map
package/dist/sk-SK.mjs CHANGED
@@ -6,4 +6,4 @@ $5ca94db2a021a726$exports = {
6
6
 
7
7
 
8
8
  export {$5ca94db2a021a726$exports as default};
9
- //# sourceMappingURL=sk-SK.module.js.map
9
+ //# sourceMappingURL=sk-SK.mjs.map
package/dist/sl-SI.mjs CHANGED
@@ -6,4 +6,4 @@ $2c7a753ed24e9851$exports = {
6
6
 
7
7
 
8
8
  export {$2c7a753ed24e9851$exports as default};
9
- //# sourceMappingURL=sl-SI.module.js.map
9
+ //# sourceMappingURL=sl-SI.mjs.map
package/dist/sr-SP.mjs CHANGED
@@ -6,4 +6,4 @@ $14a1d1750c9de591$exports = {
6
6
 
7
7
 
8
8
  export {$14a1d1750c9de591$exports as default};
9
- //# sourceMappingURL=sr-SP.module.js.map
9
+ //# sourceMappingURL=sr-SP.mjs.map
package/dist/sv-SE.mjs CHANGED
@@ -6,4 +6,4 @@ $bf3f89a84488b301$exports = {
6
6
 
7
7
 
8
8
  export {$bf3f89a84488b301$exports as default};
9
- //# sourceMappingURL=sv-SE.module.js.map
9
+ //# sourceMappingURL=sv-SE.mjs.map
package/dist/tr-TR.mjs CHANGED
@@ -6,4 +6,4 @@ $1ff90abddf42fc72$exports = {
6
6
 
7
7
 
8
8
  export {$1ff90abddf42fc72$exports as default};
9
- //# sourceMappingURL=tr-TR.module.js.map
9
+ //# sourceMappingURL=tr-TR.mjs.map
package/dist/uk-UA.mjs CHANGED
@@ -6,4 +6,4 @@ $4f07d8c17926a679$exports = {
6
6
 
7
7
 
8
8
  export {$4f07d8c17926a679$exports as default};
9
- //# sourceMappingURL=uk-UA.module.js.map
9
+ //# sourceMappingURL=uk-UA.mjs.map
@@ -285,4 +285,4 @@
285
285
  color: graytext;
286
286
  }
287
287
  }
288
- /*# sourceMappingURL=main.css.map */
288
+ /*# sourceMappingURL=vars.7b6f8dc5.css.map */
@@ -1 +1 @@
1
- {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;;AAWE;;;;;AAIE;;;;AAIA;;;;AAIA;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASJ;;;;;;;;;AAWA;;;;;;;;;;;AAeE;;;;;;AASF;;;;AAIA;;;;AAUA;;;;AAIA;;;;;;;;;;;AAiBE;;;;;AAMA;;;;AAWF;;;;AAIA;;;;;AAIE;;;;AAKF;;;;;;AAWA;;;;;;;AAME;;;;;AAIE;;;;;AAMF;;;;AAiBF;;;;AAOM;;;;AAQF;;;;AAKE;;;;AAQF;;;;AAIE;;;;AAQJ;;;;AAMA;;;;AAIA;;;;AAMA;;;;AAKF;EACE;;;;;;;;;;;;;;;EAgBE;;;;EAEE","sources":["packages/@adobe/spectrum-css-temp/components/dropdown/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;;;;;;;;;;AAWE;;;;;AAIE;;;;AAIA;;;;AAIA;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASJ;;;;;;;;;AAWA;;;;;;;;;;;AAeE;;;;;;AASF;;;;AAIA;;;;AAUA;;;;AAIA;;;;;;;;;;;AAiBE;;;;;AAMA;;;;AAWF;;;;AAIA;;;;;AAIE;;;;AAKF;;;;;;AAWA;;;;;;;AAME;;;;;AAIE;;;;;AAMF;;;;AAiBF;;;;AAOM;;;;AAQF;;;;AAKE;;;;AAQF;;;;AAIE;;;;AAQJ;;;;AAMA;;;;AAIA;;;;AAMA;;;;AAKF;EACE;;;;;;;;;;;;;;;EAgBE;;;;EAEE","sources":["packages/@adobe/spectrum-css-temp/components/dropdown/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.7b6f8dc5.css.map"}
package/dist/zh-CN.mjs CHANGED
@@ -6,4 +6,4 @@ $07a8d3b903fa886f$exports = {
6
6
 
7
7
 
8
8
  export {$07a8d3b903fa886f$exports as default};
9
- //# sourceMappingURL=zh-CN.module.js.map
9
+ //# sourceMappingURL=zh-CN.mjs.map
package/dist/zh-TW.mjs CHANGED
@@ -6,4 +6,4 @@ $e1416a5539091e36$exports = {
6
6
 
7
7
 
8
8
  export {$e1416a5539091e36$exports as default};
9
- //# sourceMappingURL=zh-TW.module.js.map
9
+ //# sourceMappingURL=zh-TW.mjs.map