@react-spectrum/picker 3.16.6 → 3.17.0

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 (198) hide show
  1. package/dist/import.mjs +5 -3
  2. package/dist/main.js +7 -5
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +5 -3
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +4 -0
  7. package/package.json +14 -42
  8. package/src/index.ts +5 -3
  9. package/dist/Picker.main.js +0 -230
  10. package/dist/Picker.main.js.map +0 -1
  11. package/dist/Picker.mjs +0 -225
  12. package/dist/Picker.module.js +0 -225
  13. package/dist/Picker.module.js.map +0 -1
  14. package/dist/ar-AE.main.js +0 -7
  15. package/dist/ar-AE.main.js.map +0 -1
  16. package/dist/ar-AE.mjs +0 -9
  17. package/dist/ar-AE.module.js +0 -9
  18. package/dist/ar-AE.module.js.map +0 -1
  19. package/dist/bg-BG.main.js +0 -7
  20. package/dist/bg-BG.main.js.map +0 -1
  21. package/dist/bg-BG.mjs +0 -9
  22. package/dist/bg-BG.module.js +0 -9
  23. package/dist/bg-BG.module.js.map +0 -1
  24. package/dist/cs-CZ.main.js +0 -7
  25. package/dist/cs-CZ.main.js.map +0 -1
  26. package/dist/cs-CZ.mjs +0 -9
  27. package/dist/cs-CZ.module.js +0 -9
  28. package/dist/cs-CZ.module.js.map +0 -1
  29. package/dist/da-DK.main.js +0 -7
  30. package/dist/da-DK.main.js.map +0 -1
  31. package/dist/da-DK.mjs +0 -9
  32. package/dist/da-DK.module.js +0 -9
  33. package/dist/da-DK.module.js.map +0 -1
  34. package/dist/de-DE.main.js +0 -7
  35. package/dist/de-DE.main.js.map +0 -1
  36. package/dist/de-DE.mjs +0 -9
  37. package/dist/de-DE.module.js +0 -9
  38. package/dist/de-DE.module.js.map +0 -1
  39. package/dist/dropdown_vars_css.main.js +0 -77
  40. package/dist/dropdown_vars_css.main.js.map +0 -1
  41. package/dist/dropdown_vars_css.mjs +0 -79
  42. package/dist/dropdown_vars_css.module.js +0 -79
  43. package/dist/dropdown_vars_css.module.js.map +0 -1
  44. package/dist/el-GR.main.js +0 -7
  45. package/dist/el-GR.main.js.map +0 -1
  46. package/dist/el-GR.mjs +0 -9
  47. package/dist/el-GR.module.js +0 -9
  48. package/dist/el-GR.module.js.map +0 -1
  49. package/dist/en-US.main.js +0 -7
  50. package/dist/en-US.main.js.map +0 -1
  51. package/dist/en-US.mjs +0 -9
  52. package/dist/en-US.module.js +0 -9
  53. package/dist/en-US.module.js.map +0 -1
  54. package/dist/es-ES.main.js +0 -7
  55. package/dist/es-ES.main.js.map +0 -1
  56. package/dist/es-ES.mjs +0 -9
  57. package/dist/es-ES.module.js +0 -9
  58. package/dist/es-ES.module.js.map +0 -1
  59. package/dist/et-EE.main.js +0 -7
  60. package/dist/et-EE.main.js.map +0 -1
  61. package/dist/et-EE.mjs +0 -9
  62. package/dist/et-EE.module.js +0 -9
  63. package/dist/et-EE.module.js.map +0 -1
  64. package/dist/fi-FI.main.js +0 -7
  65. package/dist/fi-FI.main.js.map +0 -1
  66. package/dist/fi-FI.mjs +0 -9
  67. package/dist/fi-FI.module.js +0 -9
  68. package/dist/fi-FI.module.js.map +0 -1
  69. package/dist/fr-FR.main.js +0 -7
  70. package/dist/fr-FR.main.js.map +0 -1
  71. package/dist/fr-FR.mjs +0 -9
  72. package/dist/fr-FR.module.js +0 -9
  73. package/dist/fr-FR.module.js.map +0 -1
  74. package/dist/he-IL.main.js +0 -7
  75. package/dist/he-IL.main.js.map +0 -1
  76. package/dist/he-IL.mjs +0 -9
  77. package/dist/he-IL.module.js +0 -9
  78. package/dist/he-IL.module.js.map +0 -1
  79. package/dist/hr-HR.main.js +0 -7
  80. package/dist/hr-HR.main.js.map +0 -1
  81. package/dist/hr-HR.mjs +0 -9
  82. package/dist/hr-HR.module.js +0 -9
  83. package/dist/hr-HR.module.js.map +0 -1
  84. package/dist/hu-HU.main.js +0 -7
  85. package/dist/hu-HU.main.js.map +0 -1
  86. package/dist/hu-HU.mjs +0 -9
  87. package/dist/hu-HU.module.js +0 -9
  88. package/dist/hu-HU.module.js.map +0 -1
  89. package/dist/intlStrings.main.js +0 -108
  90. package/dist/intlStrings.main.js.map +0 -1
  91. package/dist/intlStrings.mjs +0 -110
  92. package/dist/intlStrings.module.js +0 -110
  93. package/dist/intlStrings.module.js.map +0 -1
  94. package/dist/it-IT.main.js +0 -7
  95. package/dist/it-IT.main.js.map +0 -1
  96. package/dist/it-IT.mjs +0 -9
  97. package/dist/it-IT.module.js +0 -9
  98. package/dist/it-IT.module.js.map +0 -1
  99. package/dist/ja-JP.main.js +0 -7
  100. package/dist/ja-JP.main.js.map +0 -1
  101. package/dist/ja-JP.mjs +0 -9
  102. package/dist/ja-JP.module.js +0 -9
  103. package/dist/ja-JP.module.js.map +0 -1
  104. package/dist/ko-KR.main.js +0 -7
  105. package/dist/ko-KR.main.js.map +0 -1
  106. package/dist/ko-KR.mjs +0 -9
  107. package/dist/ko-KR.module.js +0 -9
  108. package/dist/ko-KR.module.js.map +0 -1
  109. package/dist/lt-LT.main.js +0 -7
  110. package/dist/lt-LT.main.js.map +0 -1
  111. package/dist/lt-LT.mjs +0 -9
  112. package/dist/lt-LT.module.js +0 -9
  113. package/dist/lt-LT.module.js.map +0 -1
  114. package/dist/lv-LV.main.js +0 -7
  115. package/dist/lv-LV.main.js.map +0 -1
  116. package/dist/lv-LV.mjs +0 -9
  117. package/dist/lv-LV.module.js +0 -9
  118. package/dist/lv-LV.module.js.map +0 -1
  119. package/dist/nb-NO.main.js +0 -7
  120. package/dist/nb-NO.main.js.map +0 -1
  121. package/dist/nb-NO.mjs +0 -9
  122. package/dist/nb-NO.module.js +0 -9
  123. package/dist/nb-NO.module.js.map +0 -1
  124. package/dist/nl-NL.main.js +0 -7
  125. package/dist/nl-NL.main.js.map +0 -1
  126. package/dist/nl-NL.mjs +0 -9
  127. package/dist/nl-NL.module.js +0 -9
  128. package/dist/nl-NL.module.js.map +0 -1
  129. package/dist/picker.6ed9ee86.css +0 -288
  130. package/dist/picker.6ed9ee86.css.map +0 -1
  131. package/dist/pl-PL.main.js +0 -7
  132. package/dist/pl-PL.main.js.map +0 -1
  133. package/dist/pl-PL.mjs +0 -9
  134. package/dist/pl-PL.module.js +0 -9
  135. package/dist/pl-PL.module.js.map +0 -1
  136. package/dist/pt-BR.main.js +0 -7
  137. package/dist/pt-BR.main.js.map +0 -1
  138. package/dist/pt-BR.mjs +0 -9
  139. package/dist/pt-BR.module.js +0 -9
  140. package/dist/pt-BR.module.js.map +0 -1
  141. package/dist/pt-PT.main.js +0 -7
  142. package/dist/pt-PT.main.js.map +0 -1
  143. package/dist/pt-PT.mjs +0 -9
  144. package/dist/pt-PT.module.js +0 -9
  145. package/dist/pt-PT.module.js.map +0 -1
  146. package/dist/ro-RO.main.js +0 -7
  147. package/dist/ro-RO.main.js.map +0 -1
  148. package/dist/ro-RO.mjs +0 -9
  149. package/dist/ro-RO.module.js +0 -9
  150. package/dist/ro-RO.module.js.map +0 -1
  151. package/dist/ru-RU.main.js +0 -7
  152. package/dist/ru-RU.main.js.map +0 -1
  153. package/dist/ru-RU.mjs +0 -9
  154. package/dist/ru-RU.module.js +0 -9
  155. package/dist/ru-RU.module.js.map +0 -1
  156. package/dist/sk-SK.main.js +0 -7
  157. package/dist/sk-SK.main.js.map +0 -1
  158. package/dist/sk-SK.mjs +0 -9
  159. package/dist/sk-SK.module.js +0 -9
  160. package/dist/sk-SK.module.js.map +0 -1
  161. package/dist/sl-SI.main.js +0 -7
  162. package/dist/sl-SI.main.js.map +0 -1
  163. package/dist/sl-SI.mjs +0 -9
  164. package/dist/sl-SI.module.js +0 -9
  165. package/dist/sl-SI.module.js.map +0 -1
  166. package/dist/sr-SP.main.js +0 -7
  167. package/dist/sr-SP.main.js.map +0 -1
  168. package/dist/sr-SP.mjs +0 -9
  169. package/dist/sr-SP.module.js +0 -9
  170. package/dist/sr-SP.module.js.map +0 -1
  171. package/dist/sv-SE.main.js +0 -7
  172. package/dist/sv-SE.main.js.map +0 -1
  173. package/dist/sv-SE.mjs +0 -9
  174. package/dist/sv-SE.module.js +0 -9
  175. package/dist/sv-SE.module.js.map +0 -1
  176. package/dist/tr-TR.main.js +0 -7
  177. package/dist/tr-TR.main.js.map +0 -1
  178. package/dist/tr-TR.mjs +0 -9
  179. package/dist/tr-TR.module.js +0 -9
  180. package/dist/tr-TR.module.js.map +0 -1
  181. package/dist/types.d.ts +0 -13
  182. package/dist/types.d.ts.map +0 -1
  183. package/dist/uk-UA.main.js +0 -7
  184. package/dist/uk-UA.main.js.map +0 -1
  185. package/dist/uk-UA.mjs +0 -9
  186. package/dist/uk-UA.module.js +0 -9
  187. package/dist/uk-UA.module.js.map +0 -1
  188. package/dist/zh-CN.main.js +0 -7
  189. package/dist/zh-CN.main.js.map +0 -1
  190. package/dist/zh-CN.mjs +0 -9
  191. package/dist/zh-CN.module.js +0 -9
  192. package/dist/zh-CN.module.js.map +0 -1
  193. package/dist/zh-TW.main.js +0 -7
  194. package/dist/zh-TW.main.js.map +0 -1
  195. package/dist/zh-TW.mjs +0 -9
  196. package/dist/zh-TW.module.js +0 -9
  197. package/dist/zh-TW.module.js.map +0 -1
  198. package/src/Picker.tsx +0 -254
package/dist/Picker.mjs DELETED
@@ -1,225 +0,0 @@
1
- import $6hDYZ$intlStringsmodulejs from "./intlStrings.mjs";
2
- import "./picker.6ed9ee86.css";
3
- import $6hDYZ$dropdown_vars_cssmodulejs from "./dropdown_vars_css.mjs";
4
- import $6hDYZ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
5
- import $6hDYZ$spectrumiconsuiChevronDownMedium from "@spectrum-icons/ui/ChevronDownMedium";
6
- import {useSlotProps as $6hDYZ$useSlotProps, useDOMRef as $6hDYZ$useDOMRef, useUnwrapDOMRef as $6hDYZ$useUnwrapDOMRef, useIsMobileDevice as $6hDYZ$useIsMobileDevice, dimensionValue as $6hDYZ$dimensionValue, classNames as $6hDYZ$classNames, SlotProvider as $6hDYZ$SlotProvider} from "@react-spectrum/utils";
7
- import {Field as $6hDYZ$Field} from "@react-spectrum/label";
8
- import {FieldButton as $6hDYZ$FieldButton} from "@react-spectrum/button";
9
- import {useSelect as $6hDYZ$useSelect, HiddenSelect as $6hDYZ$HiddenSelect} from "@react-aria/select";
10
- import {useListBoxLayout as $6hDYZ$useListBoxLayout, ListBoxBase as $6hDYZ$ListBoxBase} from "@react-spectrum/listbox";
11
- import {useId as $6hDYZ$useId, useResizeObserver as $6hDYZ$useResizeObserver, useLayoutEffect as $6hDYZ$useLayoutEffect, mergeProps as $6hDYZ$mergeProps} from "@react-aria/utils";
12
- import {Tray as $6hDYZ$Tray, Popover as $6hDYZ$Popover} from "@react-spectrum/overlays";
13
- import {useHover as $6hDYZ$useHover, PressResponder as $6hDYZ$PressResponder} from "@react-aria/interactions";
14
- import {ProgressCircle as $6hDYZ$ProgressCircle} from "@react-spectrum/progress";
15
- import $6hDYZ$react, {useRef as $6hDYZ$useRef, useState as $6hDYZ$useState, useCallback as $6hDYZ$useCallback} from "react";
16
- import {Text as $6hDYZ$Text} from "@react-spectrum/text";
17
- import {useFormProps as $6hDYZ$useFormProps} from "@react-spectrum/form";
18
- import {useLocalizedStringFormatter as $6hDYZ$useLocalizedStringFormatter} from "@react-aria/i18n";
19
- import {useProviderProps as $6hDYZ$useProviderProps, useProvider as $6hDYZ$useProvider} from "@react-spectrum/provider";
20
- import {useSelectState as $6hDYZ$useSelectState} from "@react-stately/select";
21
-
22
-
23
- function $parcel$interopDefault(a) {
24
- return a && a.__esModule ? a.default : a;
25
- }
26
- /*
27
- * Copyright 2020 Adobe. All rights reserved.
28
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
29
- * you may not use this file except in compliance with the License. You may obtain a copy
30
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
31
- *
32
- * Unless required by applicable law or agreed to in writing, software distributed under
33
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
34
- * OF ANY KIND, either express or implied. See the License for the specific language
35
- * governing permissions and limitations under the License.
36
- */
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
- const $51664a9007a3c6f9$export$ba25329847403e11 = /*#__PURE__*/ (0, $6hDYZ$react).forwardRef(function Picker(props, ref) {
56
- props = (0, $6hDYZ$useSlotProps)(props, 'picker');
57
- props = (0, $6hDYZ$useProviderProps)(props);
58
- props = (0, $6hDYZ$useFormProps)(props);
59
- let stringFormatter = (0, $6hDYZ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($6hDYZ$intlStringsmodulejs))), '@react-spectrum/picker');
60
- let { autoComplete: autoComplete, isDisabled: isDisabled, direction: direction = 'bottom', align: align = 'start', shouldFlip: shouldFlip = true, placeholder: placeholder = stringFormatter.format('placeholder'), isQuiet: isQuiet, labelPosition: labelPosition = 'top', menuWidth: menuWidth, autoFocus: autoFocus } = props;
61
- let state = (0, $6hDYZ$useSelectState)(props);
62
- let domRef = (0, $6hDYZ$useDOMRef)(ref);
63
- let popoverRef = (0, $6hDYZ$useRef)(null);
64
- let triggerRef = (0, $6hDYZ$useRef)(null);
65
- let unwrappedTriggerRef = (0, $6hDYZ$useUnwrapDOMRef)(triggerRef);
66
- let listboxRef = (0, $6hDYZ$useRef)(null);
67
- let isLoadingInitial = props.isLoading && state.collection.size === 0;
68
- let isLoadingMore = props.isLoading && state.collection.size > 0;
69
- let progressCircleId = (0, $6hDYZ$useId)();
70
- // We create the listbox layout in Picker and pass it to ListBoxBase below
71
- // so that the layout information can be cached even while the listbox is not mounted.
72
- // We also use the layout as the keyboard delegate for type to select.
73
- let layout = (0, $6hDYZ$useListBoxLayout)();
74
- let { labelProps: labelProps, triggerProps: triggerProps, valueProps: valueProps, menuProps: menuProps, hiddenSelectProps: hiddenSelectProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $6hDYZ$useSelect)({
75
- ...props,
76
- 'aria-describedby': isLoadingInitial ? progressCircleId : undefined
77
- }, state, unwrappedTriggerRef);
78
- let isMobile = (0, $6hDYZ$useIsMobileDevice)();
79
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $6hDYZ$useHover)({
80
- isDisabled: isDisabled
81
- });
82
- // On small screen devices, the listbox is rendered in a tray, otherwise a popover.
83
- let listbox = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$ListBoxBase), {
84
- ...menuProps,
85
- ref: listboxRef,
86
- disallowEmptySelection: true,
87
- autoFocus: state.focusStrategy || true,
88
- shouldSelectOnPressUp: true,
89
- focusOnPointerEnter: true,
90
- layout: layout,
91
- state: state,
92
- width: isMobile ? '100%' : undefined,
93
- // Set max height: inherit so Tray scrolling works
94
- UNSAFE_style: {
95
- maxHeight: 'inherit'
96
- },
97
- isLoading: props.isLoading,
98
- showLoadingSpinner: isLoadingMore,
99
- onLoadMore: props.onLoadMore
100
- });
101
- // Measure the width of the button to inform the width of the menu (below).
102
- let [buttonWidth, setButtonWidth] = (0, $6hDYZ$useState)(undefined);
103
- let { scale: scale } = (0, $6hDYZ$useProvider)();
104
- let onResize = (0, $6hDYZ$useCallback)(()=>{
105
- if (!isMobile && unwrappedTriggerRef.current) {
106
- let width = unwrappedTriggerRef.current.offsetWidth;
107
- setButtonWidth(width);
108
- }
109
- }, [
110
- unwrappedTriggerRef,
111
- setButtonWidth,
112
- isMobile
113
- ]);
114
- (0, $6hDYZ$useResizeObserver)({
115
- ref: unwrappedTriggerRef,
116
- onResize: onResize
117
- });
118
- (0, $6hDYZ$useLayoutEffect)(onResize, [
119
- scale,
120
- state.selectedKey,
121
- onResize
122
- ]);
123
- let overlay;
124
- if (isMobile) overlay = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Tray), {
125
- state: state
126
- }, listbox);
127
- else {
128
- // If quiet, use the default width, otherwise match the width of the button. This can be overridden by the menuWidth prop.
129
- // Always have a minimum width of the button width. When quiet, there is an extra offset to add.
130
- // Not using style props for this because they don't support `calc`.
131
- let width = isQuiet ? undefined : buttonWidth;
132
- let style = {
133
- width: menuWidth ? (0, $6hDYZ$dimensionValue)(menuWidth) : width,
134
- minWidth: isQuiet ? `calc(${buttonWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : buttonWidth
135
- };
136
- overlay = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Popover), {
137
- UNSAFE_style: style,
138
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-popover', {
139
- 'spectrum-Dropdown-popover--quiet': isQuiet
140
- }),
141
- ref: popoverRef,
142
- placement: `${direction} ${align}`,
143
- shouldFlip: shouldFlip,
144
- hideArrow: true,
145
- state: state,
146
- triggerRef: unwrappedTriggerRef,
147
- scrollRef: listboxRef,
148
- shouldContainFocus: true
149
- }, listbox);
150
- }
151
- let contents = state.selectedItem ? state.selectedItem.rendered : placeholder;
152
- if (typeof contents === 'string') contents = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Text), null, contents);
153
- let picker = /*#__PURE__*/ (0, $6hDYZ$react).createElement("div", {
154
- className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown', {
155
- 'is-invalid': isInvalid && !isDisabled,
156
- 'is-disabled': isDisabled,
157
- 'spectrum-Dropdown--quiet': isQuiet
158
- })
159
- }, /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$HiddenSelect), {
160
- autoComplete: autoComplete,
161
- ...hiddenSelectProps
162
- }), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$PressResponder), (0, $6hDYZ$mergeProps)(hoverProps, triggerProps), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$FieldButton), {
163
- ref: triggerRef,
164
- isActive: state.isOpen,
165
- isQuiet: isQuiet,
166
- isDisabled: isDisabled,
167
- isInvalid: isInvalid,
168
- autoFocus: autoFocus,
169
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-trigger', {
170
- 'is-hovered': isHovered
171
- })
172
- }, /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$SlotProvider), {
173
- slots: {
174
- icon: {
175
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Icon'),
176
- size: 'S'
177
- },
178
- avatar: {
179
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-avatar'),
180
- size: 'avatar-size-100'
181
- },
182
- text: {
183
- ...valueProps,
184
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-label', {
185
- 'is-placeholder': !state.selectedItem
186
- })
187
- },
188
- description: {
189
- isHidden: true
190
- }
191
- }
192
- }, contents), isLoadingInitial && /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$ProgressCircle), {
193
- id: progressCircleId,
194
- isIndeterminate: true,
195
- size: "S",
196
- "aria-label": stringFormatter.format('loading'),
197
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-progressCircle')
198
- }), isInvalid && !isLoadingInitial && !isDisabled && /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$spectrumiconsuiAlertMedium), {
199
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-invalidIcon')
200
- }), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$spectrumiconsuiChevronDownMedium), {
201
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-chevron')
202
- }))), state.collection.size === 0 ? null : overlay);
203
- let wrapperClassName = (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Field', {
204
- 'spectrum-Dropdown-fieldWrapper--quiet': isQuiet,
205
- 'spectrum-Dropdown-fieldWrapper--positionSide': labelPosition === 'side'
206
- });
207
- return /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Field), {
208
- ...props,
209
- ref: domRef,
210
- wrapperClassName: wrapperClassName,
211
- labelProps: labelProps,
212
- descriptionProps: descriptionProps,
213
- errorMessageProps: errorMessageProps,
214
- isInvalid: isInvalid,
215
- validationErrors: validationErrors,
216
- validationDetails: validationDetails,
217
- showErrorIcon: false,
218
- includeNecessityIndicatorInAccessibilityName: true,
219
- elementType: "span"
220
- }, picker);
221
- });
222
-
223
-
224
- export {$51664a9007a3c6f9$export$ba25329847403e11 as Picker};
225
- //# sourceMappingURL=Picker.module.js.map
@@ -1,225 +0,0 @@
1
- import $6hDYZ$intlStringsmodulejs from "./intlStrings.module.js";
2
- import "./picker.6ed9ee86.css";
3
- import $6hDYZ$dropdown_vars_cssmodulejs from "./dropdown_vars_css.module.js";
4
- import $6hDYZ$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
5
- import $6hDYZ$spectrumiconsuiChevronDownMedium from "@spectrum-icons/ui/ChevronDownMedium";
6
- import {useSlotProps as $6hDYZ$useSlotProps, useDOMRef as $6hDYZ$useDOMRef, useUnwrapDOMRef as $6hDYZ$useUnwrapDOMRef, useIsMobileDevice as $6hDYZ$useIsMobileDevice, dimensionValue as $6hDYZ$dimensionValue, classNames as $6hDYZ$classNames, SlotProvider as $6hDYZ$SlotProvider} from "@react-spectrum/utils";
7
- import {Field as $6hDYZ$Field} from "@react-spectrum/label";
8
- import {FieldButton as $6hDYZ$FieldButton} from "@react-spectrum/button";
9
- import {useSelect as $6hDYZ$useSelect, HiddenSelect as $6hDYZ$HiddenSelect} from "@react-aria/select";
10
- import {useListBoxLayout as $6hDYZ$useListBoxLayout, ListBoxBase as $6hDYZ$ListBoxBase} from "@react-spectrum/listbox";
11
- import {useId as $6hDYZ$useId, useResizeObserver as $6hDYZ$useResizeObserver, useLayoutEffect as $6hDYZ$useLayoutEffect, mergeProps as $6hDYZ$mergeProps} from "@react-aria/utils";
12
- import {Tray as $6hDYZ$Tray, Popover as $6hDYZ$Popover} from "@react-spectrum/overlays";
13
- import {useHover as $6hDYZ$useHover, PressResponder as $6hDYZ$PressResponder} from "@react-aria/interactions";
14
- import {ProgressCircle as $6hDYZ$ProgressCircle} from "@react-spectrum/progress";
15
- import $6hDYZ$react, {useRef as $6hDYZ$useRef, useState as $6hDYZ$useState, useCallback as $6hDYZ$useCallback} from "react";
16
- import {Text as $6hDYZ$Text} from "@react-spectrum/text";
17
- import {useFormProps as $6hDYZ$useFormProps} from "@react-spectrum/form";
18
- import {useLocalizedStringFormatter as $6hDYZ$useLocalizedStringFormatter} from "@react-aria/i18n";
19
- import {useProviderProps as $6hDYZ$useProviderProps, useProvider as $6hDYZ$useProvider} from "@react-spectrum/provider";
20
- import {useSelectState as $6hDYZ$useSelectState} from "@react-stately/select";
21
-
22
-
23
- function $parcel$interopDefault(a) {
24
- return a && a.__esModule ? a.default : a;
25
- }
26
- /*
27
- * Copyright 2020 Adobe. All rights reserved.
28
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
29
- * you may not use this file except in compliance with the License. You may obtain a copy
30
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
31
- *
32
- * Unless required by applicable law or agreed to in writing, software distributed under
33
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
34
- * OF ANY KIND, either express or implied. See the License for the specific language
35
- * governing permissions and limitations under the License.
36
- */
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
- const $51664a9007a3c6f9$export$ba25329847403e11 = /*#__PURE__*/ (0, $6hDYZ$react).forwardRef(function Picker(props, ref) {
56
- props = (0, $6hDYZ$useSlotProps)(props, 'picker');
57
- props = (0, $6hDYZ$useProviderProps)(props);
58
- props = (0, $6hDYZ$useFormProps)(props);
59
- let stringFormatter = (0, $6hDYZ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($6hDYZ$intlStringsmodulejs))), '@react-spectrum/picker');
60
- let { autoComplete: autoComplete, isDisabled: isDisabled, direction: direction = 'bottom', align: align = 'start', shouldFlip: shouldFlip = true, placeholder: placeholder = stringFormatter.format('placeholder'), isQuiet: isQuiet, labelPosition: labelPosition = 'top', menuWidth: menuWidth, autoFocus: autoFocus } = props;
61
- let state = (0, $6hDYZ$useSelectState)(props);
62
- let domRef = (0, $6hDYZ$useDOMRef)(ref);
63
- let popoverRef = (0, $6hDYZ$useRef)(null);
64
- let triggerRef = (0, $6hDYZ$useRef)(null);
65
- let unwrappedTriggerRef = (0, $6hDYZ$useUnwrapDOMRef)(triggerRef);
66
- let listboxRef = (0, $6hDYZ$useRef)(null);
67
- let isLoadingInitial = props.isLoading && state.collection.size === 0;
68
- let isLoadingMore = props.isLoading && state.collection.size > 0;
69
- let progressCircleId = (0, $6hDYZ$useId)();
70
- // We create the listbox layout in Picker and pass it to ListBoxBase below
71
- // so that the layout information can be cached even while the listbox is not mounted.
72
- // We also use the layout as the keyboard delegate for type to select.
73
- let layout = (0, $6hDYZ$useListBoxLayout)();
74
- let { labelProps: labelProps, triggerProps: triggerProps, valueProps: valueProps, menuProps: menuProps, hiddenSelectProps: hiddenSelectProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $6hDYZ$useSelect)({
75
- ...props,
76
- 'aria-describedby': isLoadingInitial ? progressCircleId : undefined
77
- }, state, unwrappedTriggerRef);
78
- let isMobile = (0, $6hDYZ$useIsMobileDevice)();
79
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $6hDYZ$useHover)({
80
- isDisabled: isDisabled
81
- });
82
- // On small screen devices, the listbox is rendered in a tray, otherwise a popover.
83
- let listbox = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$ListBoxBase), {
84
- ...menuProps,
85
- ref: listboxRef,
86
- disallowEmptySelection: true,
87
- autoFocus: state.focusStrategy || true,
88
- shouldSelectOnPressUp: true,
89
- focusOnPointerEnter: true,
90
- layout: layout,
91
- state: state,
92
- width: isMobile ? '100%' : undefined,
93
- // Set max height: inherit so Tray scrolling works
94
- UNSAFE_style: {
95
- maxHeight: 'inherit'
96
- },
97
- isLoading: props.isLoading,
98
- showLoadingSpinner: isLoadingMore,
99
- onLoadMore: props.onLoadMore
100
- });
101
- // Measure the width of the button to inform the width of the menu (below).
102
- let [buttonWidth, setButtonWidth] = (0, $6hDYZ$useState)(undefined);
103
- let { scale: scale } = (0, $6hDYZ$useProvider)();
104
- let onResize = (0, $6hDYZ$useCallback)(()=>{
105
- if (!isMobile && unwrappedTriggerRef.current) {
106
- let width = unwrappedTriggerRef.current.offsetWidth;
107
- setButtonWidth(width);
108
- }
109
- }, [
110
- unwrappedTriggerRef,
111
- setButtonWidth,
112
- isMobile
113
- ]);
114
- (0, $6hDYZ$useResizeObserver)({
115
- ref: unwrappedTriggerRef,
116
- onResize: onResize
117
- });
118
- (0, $6hDYZ$useLayoutEffect)(onResize, [
119
- scale,
120
- state.selectedKey,
121
- onResize
122
- ]);
123
- let overlay;
124
- if (isMobile) overlay = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Tray), {
125
- state: state
126
- }, listbox);
127
- else {
128
- // If quiet, use the default width, otherwise match the width of the button. This can be overridden by the menuWidth prop.
129
- // Always have a minimum width of the button width. When quiet, there is an extra offset to add.
130
- // Not using style props for this because they don't support `calc`.
131
- let width = isQuiet ? undefined : buttonWidth;
132
- let style = {
133
- width: menuWidth ? (0, $6hDYZ$dimensionValue)(menuWidth) : width,
134
- minWidth: isQuiet ? `calc(${buttonWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : buttonWidth
135
- };
136
- overlay = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Popover), {
137
- UNSAFE_style: style,
138
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-popover', {
139
- 'spectrum-Dropdown-popover--quiet': isQuiet
140
- }),
141
- ref: popoverRef,
142
- placement: `${direction} ${align}`,
143
- shouldFlip: shouldFlip,
144
- hideArrow: true,
145
- state: state,
146
- triggerRef: unwrappedTriggerRef,
147
- scrollRef: listboxRef,
148
- shouldContainFocus: true
149
- }, listbox);
150
- }
151
- let contents = state.selectedItem ? state.selectedItem.rendered : placeholder;
152
- if (typeof contents === 'string') contents = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Text), null, contents);
153
- let picker = /*#__PURE__*/ (0, $6hDYZ$react).createElement("div", {
154
- className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown', {
155
- 'is-invalid': isInvalid && !isDisabled,
156
- 'is-disabled': isDisabled,
157
- 'spectrum-Dropdown--quiet': isQuiet
158
- })
159
- }, /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$HiddenSelect), {
160
- autoComplete: autoComplete,
161
- ...hiddenSelectProps
162
- }), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$PressResponder), (0, $6hDYZ$mergeProps)(hoverProps, triggerProps), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$FieldButton), {
163
- ref: triggerRef,
164
- isActive: state.isOpen,
165
- isQuiet: isQuiet,
166
- isDisabled: isDisabled,
167
- isInvalid: isInvalid,
168
- autoFocus: autoFocus,
169
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-trigger', {
170
- 'is-hovered': isHovered
171
- })
172
- }, /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$SlotProvider), {
173
- slots: {
174
- icon: {
175
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Icon'),
176
- size: 'S'
177
- },
178
- avatar: {
179
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-avatar'),
180
- size: 'avatar-size-100'
181
- },
182
- text: {
183
- ...valueProps,
184
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-label', {
185
- 'is-placeholder': !state.selectedItem
186
- })
187
- },
188
- description: {
189
- isHidden: true
190
- }
191
- }
192
- }, contents), isLoadingInitial && /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$ProgressCircle), {
193
- id: progressCircleId,
194
- isIndeterminate: true,
195
- size: "S",
196
- "aria-label": stringFormatter.format('loading'),
197
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-progressCircle')
198
- }), isInvalid && !isLoadingInitial && !isDisabled && /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$spectrumiconsuiAlertMedium), {
199
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-invalidIcon')
200
- }), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$spectrumiconsuiChevronDownMedium), {
201
- UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Dropdown-chevron')
202
- }))), state.collection.size === 0 ? null : overlay);
203
- let wrapperClassName = (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), 'spectrum-Field', {
204
- 'spectrum-Dropdown-fieldWrapper--quiet': isQuiet,
205
- 'spectrum-Dropdown-fieldWrapper--positionSide': labelPosition === 'side'
206
- });
207
- return /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Field), {
208
- ...props,
209
- ref: domRef,
210
- wrapperClassName: wrapperClassName,
211
- labelProps: labelProps,
212
- descriptionProps: descriptionProps,
213
- errorMessageProps: errorMessageProps,
214
- isInvalid: isInvalid,
215
- validationErrors: validationErrors,
216
- validationDetails: validationDetails,
217
- showErrorIcon: false,
218
- includeNecessityIndicatorInAccessibilityName: true,
219
- elementType: "span"
220
- }, picker);
221
- });
222
-
223
-
224
- export {$51664a9007a3c6f9$export$ba25329847403e11 as Picker};
225
- //# sourceMappingURL=Picker.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;AAsCM,MAAM,0DAAS,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,OAAyB,KAA6B,EAAE,GAA2B;IACjI,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,gBACF,YAAY,cACZ,UAAU,aACV,YAAY,iBACZ,QAAQ,qBACR,aAAa,mBACb,cAAc,gBAA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CAAC,CAAA,GAAA,uCAAgB;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;UAG3D,MAAM,UAAU,CAAC,IAAI,KAAK,IAAI,OAAO;IAI1C,IAAI,mBAAmB,CAAA,GAAA,iBAAS,EAC9B,CAAA,GAAA,0DAAK,GACL,kBACA;QACE,yCAAyC;QACzC,gDAAgD,kBAAkB;IACpE;IAGF,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,kBAAkB;QAClB,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,eAAe;QACf,8CAAA;QACA,aAAY;OACX;AAGP","sources":["packages/@react-spectrum/picker/src/Picker.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 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\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\nexport const Picker = React.forwardRef(function 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 labelPosition = 'top' as LabelPosition,\n menuWidth,\n autoFocus\n } = props;\n\n let state = useSelectState(props);\n let domRef = useDOMRef(ref);\n\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let triggerRef = useRef<FocusableRefValue<HTMLElement>>(null);\n let unwrappedTriggerRef = useUnwrapDOMRef(triggerRef);\n let listboxRef = useRef(null);\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();\n let {labelProps, triggerProps, valueProps, menuProps, hiddenSelectProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useSelect({\n ...props,\n 'aria-describedby': (isLoadingInitial ? progressCircleId : undefined)\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 showLoadingSpinner={isLoadingMore}\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<number | undefined>(undefined);\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 ? undefined : 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 shouldContainFocus>\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 {...hiddenSelectProps} />\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}) as <T>(props: SpectrumPickerProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"Picker.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "loading": `\u{62C}\u{627}\u{631}\u{64D} \u{627}\u{644}\u{62A}\u{62D}\u{645}\u{64A}\u{644}...`,
3
- "placeholder": `\u{62A}\u{62D}\u{62F}\u{64A}\u{62F}\u{2026}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=ar-AE.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,iFAAe,CAAC;IAC9C,eAAe,CAAC,2CAAM,CAAC;AACzB","sources":["packages/@react-spectrum/picker/intl/ar-AE.json"],"sourcesContent":["{\n \"loading\": \"جارٍ التحميل...\",\n \"placeholder\": \"تحديد…\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}
package/dist/ar-AE.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $d1a348ee160b1c35$exports = {};
2
- $d1a348ee160b1c35$exports = {
3
- "loading": `\u{62C}\u{627}\u{631}\u{64D} \u{627}\u{644}\u{62A}\u{62D}\u{645}\u{64A}\u{644}...`,
4
- "placeholder": `\u{62A}\u{62D}\u{62F}\u{64A}\u{62F}\u{2026}`
5
- };
6
-
7
-
8
- export {$d1a348ee160b1c35$exports as default};
9
- //# sourceMappingURL=ar-AE.module.js.map
@@ -1,9 +0,0 @@
1
- var $d1a348ee160b1c35$exports = {};
2
- $d1a348ee160b1c35$exports = {
3
- "loading": `\u{62C}\u{627}\u{631}\u{64D} \u{627}\u{644}\u{62A}\u{62D}\u{645}\u{64A}\u{644}...`,
4
- "placeholder": `\u{62A}\u{62D}\u{62F}\u{64A}\u{62F}\u{2026}`
5
- };
6
-
7
-
8
- export {$d1a348ee160b1c35$exports as default};
9
- //# sourceMappingURL=ar-AE.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,iFAAe,CAAC;IAC9C,eAAe,CAAC,2CAAM,CAAC;AACzB","sources":["packages/@react-spectrum/picker/intl/ar-AE.json"],"sourcesContent":["{\n \"loading\": \"جارٍ التحميل...\",\n \"placeholder\": \"تحديد…\"\n}\n"],"names":[],"version":3,"file":"ar-AE.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "loading": `\u{417}\u{430}\u{440}\u{435}\u{436}\u{434}\u{430}\u{43D}\u{435}...`,
3
- "placeholder": `\u{418}\u{437}\u{431}\u{435}\u{440}\u{435}\u{442}\u{435}\u{2026}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=bg-BG.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,kEAAY,CAAC;IAC3C,eAAe,CAAC,gEAAS,CAAC;AAC5B","sources":["packages/@react-spectrum/picker/intl/bg-BG.json"],"sourcesContent":["{\n \"loading\": \"Зареждане...\",\n \"placeholder\": \"Изберете…\"\n}\n"],"names":[],"version":3,"file":"bg-BG.main.js.map"}
package/dist/bg-BG.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $6f4b5567d8931b2c$exports = {};
2
- $6f4b5567d8931b2c$exports = {
3
- "loading": `\u{417}\u{430}\u{440}\u{435}\u{436}\u{434}\u{430}\u{43D}\u{435}...`,
4
- "placeholder": `\u{418}\u{437}\u{431}\u{435}\u{440}\u{435}\u{442}\u{435}\u{2026}`
5
- };
6
-
7
-
8
- export {$6f4b5567d8931b2c$exports as default};
9
- //# sourceMappingURL=bg-BG.module.js.map
@@ -1,9 +0,0 @@
1
- var $6f4b5567d8931b2c$exports = {};
2
- $6f4b5567d8931b2c$exports = {
3
- "loading": `\u{417}\u{430}\u{440}\u{435}\u{436}\u{434}\u{430}\u{43D}\u{435}...`,
4
- "placeholder": `\u{418}\u{437}\u{431}\u{435}\u{440}\u{435}\u{442}\u{435}\u{2026}`
5
- };
6
-
7
-
8
- export {$6f4b5567d8931b2c$exports as default};
9
- //# sourceMappingURL=bg-BG.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,kEAAY,CAAC;IAC3C,eAAe,CAAC,gEAAS,CAAC;AAC5B","sources":["packages/@react-spectrum/picker/intl/bg-BG.json"],"sourcesContent":["{\n \"loading\": \"Зареждане...\",\n \"placeholder\": \"Изберете…\"\n}\n"],"names":[],"version":3,"file":"bg-BG.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "loading": `Na\u{10D}\xedt\xe1n\xed...`,
3
- "placeholder": `Vybrat\u{2026}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=cs-CZ.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,0BAAW,CAAC;IAC1C,eAAe,CAAC,cAAO,CAAC;AAC1B","sources":["packages/@react-spectrum/picker/intl/cs-CZ.json"],"sourcesContent":["{\n \"loading\": \"Načítání...\",\n \"placeholder\": \"Vybrat…\"\n}\n"],"names":[],"version":3,"file":"cs-CZ.main.js.map"}
package/dist/cs-CZ.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $413f5c9b05a53d70$exports = {};
2
- $413f5c9b05a53d70$exports = {
3
- "loading": `Na\u{10D}\xedt\xe1n\xed...`,
4
- "placeholder": `Vybrat\u{2026}`
5
- };
6
-
7
-
8
- export {$413f5c9b05a53d70$exports as default};
9
- //# sourceMappingURL=cs-CZ.module.js.map
@@ -1,9 +0,0 @@
1
- var $413f5c9b05a53d70$exports = {};
2
- $413f5c9b05a53d70$exports = {
3
- "loading": `Na\u{10D}\xedt\xe1n\xed...`,
4
- "placeholder": `Vybrat\u{2026}`
5
- };
6
-
7
-
8
- export {$413f5c9b05a53d70$exports as default};
9
- //# sourceMappingURL=cs-CZ.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,0BAAW,CAAC;IAC1C,eAAe,CAAC,cAAO,CAAC;AAC1B","sources":["packages/@react-spectrum/picker/intl/cs-CZ.json"],"sourcesContent":["{\n \"loading\": \"Načítání...\",\n \"placeholder\": \"Vybrat…\"\n}\n"],"names":[],"version":3,"file":"cs-CZ.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "loading": `Indl\xe6ser ...`,
3
- "placeholder": `V\xe6lg\u{2026}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=da-DK.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,eAAY,CAAC;IAC3C,eAAe,CAAC,eAAK,CAAC;AACxB","sources":["packages/@react-spectrum/picker/intl/da-DK.json"],"sourcesContent":["{\n \"loading\": \"Indlæser ...\",\n \"placeholder\": \"Vælg…\"\n}\n"],"names":[],"version":3,"file":"da-DK.main.js.map"}
package/dist/da-DK.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $23214587b45d0c7a$exports = {};
2
- $23214587b45d0c7a$exports = {
3
- "loading": `Indl\xe6ser ...`,
4
- "placeholder": `V\xe6lg\u{2026}`
5
- };
6
-
7
-
8
- export {$23214587b45d0c7a$exports as default};
9
- //# sourceMappingURL=da-DK.module.js.map
@@ -1,9 +0,0 @@
1
- var $23214587b45d0c7a$exports = {};
2
- $23214587b45d0c7a$exports = {
3
- "loading": `Indl\xe6ser ...`,
4
- "placeholder": `V\xe6lg\u{2026}`
5
- };
6
-
7
-
8
- export {$23214587b45d0c7a$exports as default};
9
- //# sourceMappingURL=da-DK.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,eAAY,CAAC;IAC3C,eAAe,CAAC,eAAK,CAAC;AACxB","sources":["packages/@react-spectrum/picker/intl/da-DK.json"],"sourcesContent":["{\n \"loading\": \"Indlæser ...\",\n \"placeholder\": \"Vælg…\"\n}\n"],"names":[],"version":3,"file":"da-DK.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "loading": `Laden...`,
3
- "placeholder": `Ausw\xe4hlen\u{2026}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=de-DE.main.js.map