@react-spectrum/picker 3.14.4-nightly.4552 → 3.14.4-nightly.4558

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -0,0 +1,238 @@
1
+ var $b95bf71d4a256ee8$exports = require("./intlStrings.main.js");
2
+ require("./vars.7b6f8dc5.css");
3
+ var $b39b306bfc9a5551$exports = require("./dropdown_vars_css.main.js");
4
+ var $3qYcd$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
5
+ var $3qYcd$spectrumiconsuiChevronDownMedium = require("@spectrum-icons/ui/ChevronDownMedium");
6
+ var $3qYcd$reactspectrumutils = require("@react-spectrum/utils");
7
+ var $3qYcd$reactspectrumlabel = require("@react-spectrum/label");
8
+ var $3qYcd$reactspectrumbutton = require("@react-spectrum/button");
9
+ var $3qYcd$reactariaselect = require("@react-aria/select");
10
+ var $3qYcd$reactspectrumlistbox = require("@react-spectrum/listbox");
11
+ var $3qYcd$reactariautils = require("@react-aria/utils");
12
+ var $3qYcd$reactspectrumoverlays = require("@react-spectrum/overlays");
13
+ var $3qYcd$reactariainteractions = require("@react-aria/interactions");
14
+ var $3qYcd$reactspectrumprogress = require("@react-spectrum/progress");
15
+ var $3qYcd$react = require("react");
16
+ var $3qYcd$reactspectrumtext = require("@react-spectrum/text");
17
+ var $3qYcd$reactspectrumform = require("@react-spectrum/form");
18
+ var $3qYcd$reactariai18n = require("@react-aria/i18n");
19
+ var $3qYcd$reactspectrumprovider = require("@react-spectrum/provider");
20
+ var $3qYcd$reactstatelyselect = require("@react-stately/select");
21
+
22
+
23
+ function $parcel$interopDefault(a) {
24
+ return a && a.__esModule ? a.default : a;
25
+ }
26
+
27
+ function $parcel$export(e, n, v, s) {
28
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
29
+ }
30
+
31
+ $parcel$export(module.exports, "Picker", () => $902e54cfaa4270a9$export$ba25329847403e11);
32
+ /*
33
+ * Copyright 2020 Adobe. All rights reserved.
34
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
35
+ * you may not use this file except in compliance with the License. You may obtain a copy
36
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
37
+ *
38
+ * Unless required by applicable law or agreed to in writing, software distributed under
39
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40
+ * OF ANY KIND, either express or implied. See the License for the specific language
41
+ * governing permissions and limitations under the License.
42
+ */
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+ function $902e54cfaa4270a9$var$Picker(props, ref) {
62
+ props = (0, $3qYcd$reactspectrumutils.useSlotProps)(props, "picker");
63
+ props = (0, $3qYcd$reactspectrumprovider.useProviderProps)(props);
64
+ props = (0, $3qYcd$reactspectrumform.useFormProps)(props);
65
+ let stringFormatter = (0, $3qYcd$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($b95bf71d4a256ee8$exports))), "@react-spectrum/picker");
66
+ 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;
67
+ let state = (0, $3qYcd$reactstatelyselect.useSelectState)(props);
68
+ let domRef = (0, $3qYcd$reactspectrumutils.useDOMRef)(ref);
69
+ let popoverRef = (0, $3qYcd$react.useRef)();
70
+ let triggerRef = (0, $3qYcd$react.useRef)();
71
+ let unwrappedTriggerRef = (0, $3qYcd$reactspectrumutils.useUnwrapDOMRef)(triggerRef);
72
+ let listboxRef = (0, $3qYcd$react.useRef)();
73
+ let isLoadingInitial = props.isLoading && state.collection.size === 0;
74
+ let isLoadingMore = props.isLoading && state.collection.size > 0;
75
+ let progressCircleId = (0, $3qYcd$reactariautils.useId)();
76
+ // We create the listbox layout in Picker and pass it to ListBoxBase below
77
+ // so that the layout information can be cached even while the listbox is not mounted.
78
+ // We also use the layout as the keyboard delegate for type to select.
79
+ let layout = (0, $3qYcd$reactspectrumlistbox.useListBoxLayout)(state, isLoadingMore);
80
+ let { labelProps: labelProps, triggerProps: triggerProps, valueProps: valueProps, menuProps: menuProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $3qYcd$reactariaselect.useSelect)({
81
+ ...props,
82
+ "aria-describedby": isLoadingInitial ? progressCircleId : undefined,
83
+ keyboardDelegate: layout
84
+ }, state, unwrappedTriggerRef);
85
+ let isMobile = (0, $3qYcd$reactspectrumutils.useIsMobileDevice)();
86
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3qYcd$reactariainteractions.useHover)({
87
+ isDisabled: isDisabled
88
+ });
89
+ // On small screen devices, the listbox is rendered in a tray, otherwise a popover.
90
+ let listbox = /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumlistbox.ListBoxBase), {
91
+ ...menuProps,
92
+ ref: listboxRef,
93
+ disallowEmptySelection: true,
94
+ autoFocus: state.focusStrategy || true,
95
+ shouldSelectOnPressUp: true,
96
+ focusOnPointerEnter: true,
97
+ layout: layout,
98
+ state: state,
99
+ width: isMobile ? "100%" : undefined,
100
+ // Set max height: inherit so Tray scrolling works
101
+ UNSAFE_style: {
102
+ maxHeight: "inherit"
103
+ },
104
+ isLoading: props.isLoading,
105
+ onLoadMore: props.onLoadMore
106
+ });
107
+ // Measure the width of the button to inform the width of the menu (below).
108
+ let [buttonWidth, setButtonWidth] = (0, $3qYcd$react.useState)(null);
109
+ let { scale: scale } = (0, $3qYcd$reactspectrumprovider.useProvider)();
110
+ let onResize = (0, $3qYcd$react.useCallback)(()=>{
111
+ if (!isMobile && unwrappedTriggerRef.current) {
112
+ let width = unwrappedTriggerRef.current.offsetWidth;
113
+ setButtonWidth(width);
114
+ }
115
+ }, [
116
+ unwrappedTriggerRef,
117
+ setButtonWidth,
118
+ isMobile
119
+ ]);
120
+ (0, $3qYcd$reactariautils.useResizeObserver)({
121
+ ref: unwrappedTriggerRef,
122
+ onResize: onResize
123
+ });
124
+ (0, $3qYcd$reactariautils.useLayoutEffect)(onResize, [
125
+ scale,
126
+ state.selectedKey,
127
+ onResize
128
+ ]);
129
+ let overlay;
130
+ if (isMobile) overlay = /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumoverlays.Tray), {
131
+ state: state
132
+ }, listbox);
133
+ else {
134
+ // If quiet, use the default width, otherwise match the width of the button. This can be overridden by the menuWidth prop.
135
+ // Always have a minimum width of the button width. When quiet, there is an extra offset to add.
136
+ // Not using style props for this because they don't support `calc`.
137
+ let width = isQuiet ? null : buttonWidth;
138
+ let style = {
139
+ width: menuWidth ? (0, $3qYcd$reactspectrumutils.dimensionValue)(menuWidth) : width,
140
+ minWidth: isQuiet ? `calc(${buttonWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : buttonWidth
141
+ };
142
+ overlay = /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumoverlays.Popover), {
143
+ UNSAFE_style: style,
144
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown-popover", {
145
+ "spectrum-Dropdown-popover--quiet": isQuiet
146
+ }),
147
+ ref: popoverRef,
148
+ placement: `${direction} ${align}`,
149
+ shouldFlip: shouldFlip,
150
+ hideArrow: true,
151
+ state: state,
152
+ triggerRef: unwrappedTriggerRef,
153
+ scrollRef: listboxRef
154
+ }, listbox);
155
+ }
156
+ let contents = state.selectedItem ? state.selectedItem.rendered : placeholder;
157
+ if (typeof contents === "string") contents = /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumtext.Text), null, contents);
158
+ let picker = /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement("div", {
159
+ className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown", {
160
+ "is-invalid": isInvalid && !isDisabled,
161
+ "is-disabled": isDisabled,
162
+ "spectrum-Dropdown--quiet": isQuiet
163
+ })
164
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactariaselect.HiddenSelect), {
165
+ autoComplete: autoComplete,
166
+ isDisabled: isDisabled,
167
+ state: state,
168
+ triggerRef: unwrappedTriggerRef,
169
+ label: label,
170
+ name: name
171
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactariainteractions.PressResponder), (0, $3qYcd$reactariautils.mergeProps)(hoverProps, triggerProps), /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumbutton.FieldButton), {
172
+ ref: triggerRef,
173
+ isActive: state.isOpen,
174
+ isQuiet: isQuiet,
175
+ isDisabled: isDisabled,
176
+ isInvalid: isInvalid,
177
+ autoFocus: autoFocus,
178
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown-trigger", {
179
+ "is-hovered": isHovered
180
+ })
181
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumutils.SlotProvider), {
182
+ slots: {
183
+ icon: {
184
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Icon"),
185
+ size: "S"
186
+ },
187
+ avatar: {
188
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown-avatar"),
189
+ size: "avatar-size-100"
190
+ },
191
+ text: {
192
+ ...valueProps,
193
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown-label", {
194
+ "is-placeholder": !state.selectedItem
195
+ })
196
+ },
197
+ description: {
198
+ isHidden: true
199
+ }
200
+ }
201
+ }, contents), isLoadingInitial && /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumprogress.ProgressCircle), {
202
+ id: progressCircleId,
203
+ isIndeterminate: true,
204
+ size: "S",
205
+ "aria-label": stringFormatter.format("loading"),
206
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown-progressCircle")
207
+ }), isInvalid && !isLoadingInitial && !isDisabled && /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, ($parcel$interopDefault($3qYcd$spectrumiconsuiAlertMedium))), {
208
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown-invalidIcon")
209
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, ($parcel$interopDefault($3qYcd$spectrumiconsuiChevronDownMedium))), {
210
+ UNSAFE_className: (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Dropdown-chevron")
211
+ }))), state.collection.size === 0 ? null : overlay);
212
+ let wrapperClassName = (0, $3qYcd$reactspectrumutils.classNames)((0, ($parcel$interopDefault($b39b306bfc9a5551$exports))), "spectrum-Field", {
213
+ "spectrum-Dropdown-fieldWrapper--quiet": isQuiet,
214
+ "spectrum-Dropdown-fieldWrapper--positionSide": labelPosition === "side"
215
+ });
216
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).createElement((0, $3qYcd$reactspectrumlabel.Field), {
217
+ ...props,
218
+ ref: domRef,
219
+ wrapperClassName: wrapperClassName,
220
+ labelProps: labelProps,
221
+ descriptionProps: descriptionProps,
222
+ errorMessageProps: errorMessageProps,
223
+ isInvalid: isInvalid,
224
+ validationErrors: validationErrors,
225
+ validationDetails: validationDetails,
226
+ showErrorIcon: false,
227
+ includeNecessityIndicatorInAccessibilityName: true,
228
+ elementType: "span"
229
+ }, picker);
230
+ }
231
+ /**
232
+ * Pickers allow users to choose a single option from a collapsible list of options when space is limited.
233
+ */ // forwardRef doesn't support generic parameters, so cast the result to the correct type
234
+ // https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref
235
+ const $902e54cfaa4270a9$export$ba25329847403e11 = /*#__PURE__*/ (0, ($parcel$interopDefault($3qYcd$react))).forwardRef($902e54cfaa4270a9$var$Picker);
236
+
237
+
238
+ //# sourceMappingURL=Picker.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;AAiCD,SAAS,6BAAyB,KAA6B,EAAE,GAA2B;IAC1F,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAA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cAAY,gBAAgB,MAAM,CAAC;QACnC,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAExC,aAAa,CAAC,oBAAoB,CAAC,4BAClC,0DAAC,CAAA,GAAA,2DAAU;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBAEpD,0DAAC,CAAA,GAAA,iEAAgB;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;UAG3D,MAAM,UAAU,CAAC,IAAI,KAAK,IAAI,OAAO;IAI1C,IAAI,mBAAmB,CAAA,GAAA,oCAAS,EAC9B,CAAA,GAAA,mDAAK,GACL,kBACA;QACE,yCAAyC;QACzC,gDAAgD,kBAAkB;IACpE;IAGF,qBACE,0DAAC,CAAA,GAAA,+BAAI;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;AAEA;;CAEC,GACD,wFAAwF;AACxF,2GAA2G;AAC3G,MAAM,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","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\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"],"names":[],"version":3,"file":"Picker.main.js.map"}
@@ -0,0 +1,233 @@
1
+ import $6hDYZ$intlStringsmodulejs from "./intlStrings.mjs";
2
+ import "./vars.7b6f8dc5.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
+ function $51664a9007a3c6f9$var$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, label: label, labelPosition: labelPosition = "top", menuWidth: menuWidth, name: name, autoFocus: autoFocus } = props;
61
+ let state = (0, $6hDYZ$useSelectState)(props);
62
+ let domRef = (0, $6hDYZ$useDOMRef)(ref);
63
+ let popoverRef = (0, $6hDYZ$useRef)();
64
+ let triggerRef = (0, $6hDYZ$useRef)();
65
+ let unwrappedTriggerRef = (0, $6hDYZ$useUnwrapDOMRef)(triggerRef);
66
+ let listboxRef = (0, $6hDYZ$useRef)();
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)(state, isLoadingMore);
74
+ let { labelProps: labelProps, triggerProps: triggerProps, valueProps: valueProps, menuProps: menuProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = (0, $6hDYZ$useSelect)({
75
+ ...props,
76
+ "aria-describedby": isLoadingInitial ? progressCircleId : undefined,
77
+ keyboardDelegate: layout
78
+ }, state, unwrappedTriggerRef);
79
+ let isMobile = (0, $6hDYZ$useIsMobileDevice)();
80
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $6hDYZ$useHover)({
81
+ isDisabled: isDisabled
82
+ });
83
+ // On small screen devices, the listbox is rendered in a tray, otherwise a popover.
84
+ let listbox = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$ListBoxBase), {
85
+ ...menuProps,
86
+ ref: listboxRef,
87
+ disallowEmptySelection: true,
88
+ autoFocus: state.focusStrategy || true,
89
+ shouldSelectOnPressUp: true,
90
+ focusOnPointerEnter: true,
91
+ layout: layout,
92
+ state: state,
93
+ width: isMobile ? "100%" : undefined,
94
+ // Set max height: inherit so Tray scrolling works
95
+ UNSAFE_style: {
96
+ maxHeight: "inherit"
97
+ },
98
+ isLoading: props.isLoading,
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)(null);
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 ? null : 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
+ }, listbox);
149
+ }
150
+ let contents = state.selectedItem ? state.selectedItem.rendered : placeholder;
151
+ if (typeof contents === "string") contents = /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Text), null, contents);
152
+ let picker = /*#__PURE__*/ (0, $6hDYZ$react).createElement("div", {
153
+ className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Dropdown", {
154
+ "is-invalid": isInvalid && !isDisabled,
155
+ "is-disabled": isDisabled,
156
+ "spectrum-Dropdown--quiet": isQuiet
157
+ })
158
+ }, /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$HiddenSelect), {
159
+ autoComplete: autoComplete,
160
+ isDisabled: isDisabled,
161
+ state: state,
162
+ triggerRef: unwrappedTriggerRef,
163
+ label: label,
164
+ name: name
165
+ }), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$PressResponder), (0, $6hDYZ$mergeProps)(hoverProps, triggerProps), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$FieldButton), {
166
+ ref: triggerRef,
167
+ isActive: state.isOpen,
168
+ isQuiet: isQuiet,
169
+ isDisabled: isDisabled,
170
+ isInvalid: isInvalid,
171
+ autoFocus: autoFocus,
172
+ UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Dropdown-trigger", {
173
+ "is-hovered": isHovered
174
+ })
175
+ }, /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$SlotProvider), {
176
+ slots: {
177
+ icon: {
178
+ UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Icon"),
179
+ size: "S"
180
+ },
181
+ avatar: {
182
+ UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Dropdown-avatar"),
183
+ size: "avatar-size-100"
184
+ },
185
+ text: {
186
+ ...valueProps,
187
+ UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Dropdown-label", {
188
+ "is-placeholder": !state.selectedItem
189
+ })
190
+ },
191
+ description: {
192
+ isHidden: true
193
+ }
194
+ }
195
+ }, contents), isLoadingInitial && /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$ProgressCircle), {
196
+ id: progressCircleId,
197
+ isIndeterminate: true,
198
+ size: "S",
199
+ "aria-label": stringFormatter.format("loading"),
200
+ UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Dropdown-progressCircle")
201
+ }), isInvalid && !isLoadingInitial && !isDisabled && /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$spectrumiconsuiAlertMedium), {
202
+ UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Dropdown-invalidIcon")
203
+ }), /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$spectrumiconsuiChevronDownMedium), {
204
+ UNSAFE_className: (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Dropdown-chevron")
205
+ }))), state.collection.size === 0 ? null : overlay);
206
+ let wrapperClassName = (0, $6hDYZ$classNames)((0, ($parcel$interopDefault($6hDYZ$dropdown_vars_cssmodulejs))), "spectrum-Field", {
207
+ "spectrum-Dropdown-fieldWrapper--quiet": isQuiet,
208
+ "spectrum-Dropdown-fieldWrapper--positionSide": labelPosition === "side"
209
+ });
210
+ return /*#__PURE__*/ (0, $6hDYZ$react).createElement((0, $6hDYZ$Field), {
211
+ ...props,
212
+ ref: domRef,
213
+ wrapperClassName: wrapperClassName,
214
+ labelProps: labelProps,
215
+ descriptionProps: descriptionProps,
216
+ errorMessageProps: errorMessageProps,
217
+ isInvalid: isInvalid,
218
+ validationErrors: validationErrors,
219
+ validationDetails: validationDetails,
220
+ showErrorIcon: false,
221
+ includeNecessityIndicatorInAccessibilityName: true,
222
+ elementType: "span"
223
+ }, picker);
224
+ }
225
+ /**
226
+ * Pickers allow users to choose a single option from a collapsible list of options when space is limited.
227
+ */ // forwardRef doesn't support generic parameters, so cast the result to the correct type
228
+ // https://stackoverflow.com/questions/58469229/react-with-typescript-generics-while-using-react-forwardref
229
+ const $51664a9007a3c6f9$export$ba25329847403e11 = /*#__PURE__*/ (0, $6hDYZ$react).forwardRef($51664a9007a3c6f9$var$Picker);
230
+
231
+
232
+ export {$51664a9007a3c6f9$export$ba25329847403e11 as Picker};
233
+ //# sourceMappingURL=Picker.mjs.map