@react-spectrum/autocomplete 3.0.0-alpha.41 → 3.0.0-alpha.42

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.
@@ -1,11 +1,11 @@
1
1
  var $e32120882142a69f$exports = require("./intlStrings.main.js");
2
- require("./searchautocomplete.af2b88b2.css");
2
+ require("./autocomplete.02db68b2.css");
3
3
  var $83da5c2df967875d$exports = require("./searchautocomplete_css.main.js");
4
- require("./vars.3a478514.css");
4
+ require("./autocomplete.102c5c14.css");
5
5
  var $1e139f06a0a4b696$exports = require("./search_vars_css.main.js");
6
- require("./vars.02beaa3c.css");
6
+ require("./autocomplete.4eff7fc7.css");
7
7
  var $2f86633ce5b04f1e$exports = require("./inputgroup_vars_css.main.js");
8
- require("./vars.8b5c28ea.css");
8
+ require("./autocomplete.30e64bfb.css");
9
9
  var $40cb3a00c193680f$exports = require("./textfield_vars_css.main.js");
10
10
  var $56uON$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
11
11
  var $56uON$spectrumiconsuiCheckmarkMedium = require("@spectrum-icons/ui/CheckmarkMedium");
@@ -1,11 +1,11 @@
1
1
  import $9yRST$intlStringsmodulejs from "./intlStrings.mjs";
2
- import "./searchautocomplete.af2b88b2.css";
2
+ import "./autocomplete.02db68b2.css";
3
3
  import $9yRST$searchautocomplete_cssmodulejs from "./searchautocomplete_css.mjs";
4
- import "./vars.3a478514.css";
4
+ import "./autocomplete.102c5c14.css";
5
5
  import $9yRST$search_vars_cssmodulejs from "./search_vars_css.mjs";
6
- import "./vars.02beaa3c.css";
6
+ import "./autocomplete.4eff7fc7.css";
7
7
  import $9yRST$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.mjs";
8
- import "./vars.8b5c28ea.css";
8
+ import "./autocomplete.30e64bfb.css";
9
9
  import $9yRST$textfield_vars_cssmodulejs from "./textfield_vars_css.mjs";
10
10
  import $9yRST$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
11
11
  import $9yRST$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
@@ -1,11 +1,11 @@
1
1
  import $9yRST$intlStringsmodulejs from "./intlStrings.module.js";
2
- import "./searchautocomplete.af2b88b2.css";
2
+ import "./autocomplete.02db68b2.css";
3
3
  import $9yRST$searchautocomplete_cssmodulejs from "./searchautocomplete_css.module.js";
4
- import "./vars.3a478514.css";
4
+ import "./autocomplete.102c5c14.css";
5
5
  import $9yRST$search_vars_cssmodulejs from "./search_vars_css.module.js";
6
- import "./vars.02beaa3c.css";
6
+ import "./autocomplete.4eff7fc7.css";
7
7
  import $9yRST$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.module.js";
8
- import "./vars.8b5c28ea.css";
8
+ import "./autocomplete.30e64bfb.css";
9
9
  import $9yRST$textfield_vars_cssmodulejs from "./textfield_vars_css.module.js";
10
10
  import $9yRST$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
11
11
  import $9yRST$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
@@ -1,12 +1,12 @@
1
1
  var $e32120882142a69f$exports = require("./intlStrings.main.js");
2
2
  var $a9f98e219df0b64d$exports = require("./MobileSearchAutocomplete.main.js");
3
- require("./searchautocomplete.af2b88b2.css");
3
+ require("./autocomplete.02db68b2.css");
4
4
  var $83da5c2df967875d$exports = require("./searchautocomplete_css.main.js");
5
- require("./vars.3a478514.css");
5
+ require("./autocomplete.102c5c14.css");
6
6
  var $1e139f06a0a4b696$exports = require("./search_vars_css.main.js");
7
- require("./vars.02beaa3c.css");
7
+ require("./autocomplete.4eff7fc7.css");
8
8
  var $2f86633ce5b04f1e$exports = require("./inputgroup_vars_css.main.js");
9
- require("./vars.8b5c28ea.css");
9
+ require("./autocomplete.30e64bfb.css");
10
10
  var $40cb3a00c193680f$exports = require("./textfield_vars_css.main.js");
11
11
  var $k6PeR$reactspectrumutils = require("@react-spectrum/utils");
12
12
  var $k6PeR$reactspectrumbutton = require("@react-spectrum/button");
@@ -72,7 +72,7 @@ $parcel$export(module.exports, "SearchAutocomplete", () => $dcf500d58a031ca6$exp
72
72
  function $dcf500d58a031ca6$var$SearchAutocomplete(props, ref) {
73
73
  props = (0, $k6PeR$reactspectrumprovider.useProviderProps)(props);
74
74
  props = (0, $k6PeR$reactspectrumform.useFormProps)(props);
75
- if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');
75
+ if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');
76
76
  let isMobile = (0, $k6PeR$reactspectrumutils.useIsMobileDevice)();
77
77
  if (isMobile) // menuTrigger=focus/manual don't apply to mobile searchwithin
78
78
  return /*#__PURE__*/ (0, ($parcel$interopDefault($k6PeR$react))).createElement((0, $a9f98e219df0b64d$exports.MobileSearchAutocomplete), {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;AAsCD,SAAS,yCAAqC,KAAyC,EAAE,GAA8B;IACrH,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IAErB,IAAI,MAAM,WAAW,EACnB,QAAQ,IAAI,CAAC;IAGf,IAAI,WAAW,CAAA,GAAA,2CAAgB;IAC/B,IAAI,UACF,8DAA8D;IAC9D,qBAAO,0DAAC,CAAA,GAAA,kDAAuB;QAAG,GAAG,KAAK;QAAE,aAAY;QAAQ,KAAK;;SAErE,qBAAO,0DAAC;QAAwB,GAAG,KAAK;QAAE,KAAK;;AAEnD;AAEA,SAAS,oDAAgD,KAAyC,EAAE,GAA8B;IAChI,QAAQ,CAAA,GAAA,6CAAe,EAAE;IAEzB,IAAI,eACF,cAAc,qBACd,aAAa,iBACb,YAAY,iBACZ,QAAQ,kBACR,OAAO,EACP,WAAW,eA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,GAAA,mDAAW,GACX,mBACA,6BACA,sBACA;YACE,eAAe;YACf,YAAY;YACZ,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL;QAIN,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;QACzC,yBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAW,GACX;QAGJ,YAAY;QACZ,SAAS;QACT,iBAAiB;QACjB,WAAW,eAAgB,CAAA,UAAU,gBAAgB,YAAY,iBAAiB,SAAQ;QAC1F,kBAAkB,gBAAgB,OAAO,gBAAgB;QACzD,MAAM;QACN,iBAAiB,AAAC,CAAA,eAAe,MAAM,iBAAiB,eAAe,mBAAmB,IAAG,KAAM,CAAC,aAAa,cAAc;QAC/H,kBAAA;;AAIV;AAEA,IAAI,8DAA0B,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;AAG/C;;CAEC,GACD,IAAI,0DAA4B,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/autocomplete/src/SearchAutocomplete.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 */\nimport {AriaButtonProps} from '@react-types/button';\nimport {classNames, dimensionValue, useFocusableRef, useIsMobileDevice, useResizeObserver, useUnwrapDOMRef} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {DOMRefValue, FocusableRef} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps, useLayoutEffect} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport {MobileSearchAutocomplete} from './MobileSearchAutocomplete';\nimport {Popover} from '@react-spectrum/overlays';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n forwardRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchAutocompleteStyles from './searchautocomplete.css';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {SpectrumSearchAutocompleteProps} from '@react-types/autocomplete';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\nimport {useSearchAutocomplete} from '@react-aria/autocomplete';\n\nfunction SearchAutocomplete<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile searchwithin\n return <MobileSearchAutocomplete {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <SearchAutocompleteBase {...props} ref={ref} />;\n }\n}\n\nfunction ForwardSearchAutocompleteBase<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n menuWidth: customMenuWidth,\n loadingState,\n onLoadMore,\n onSubmit = () => {},\n validate\n } = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync,\n allowsCustomValue: true,\n onSelectionChange: (key) => key !== null && onSubmit(null, key),\n selectedKey: undefined,\n defaultSelectedKey: undefined,\n validate: useCallback(v => validate?.(v.inputValue), [validate])\n }\n );\n let layout = useListBoxLayout();\n\n let {inputProps, listBoxProps, labelProps, clearButtonProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useSearchAutocomplete(\n {\n ...props,\n layoutDelegate: layout,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef,\n menuTrigger\n },\n state\n );\n\n // Measure the width of the inputfield to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number>(0);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (inputRef.current) {\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(inputWidth);\n }\n }, [inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n labelProps={labelProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n ref={domRef}>\n <SearchAutocompleteInput\n {...props}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n clearButtonProps={clearButtonProps}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)} />\n </Field>\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n autoFocus={state.focusStrategy ?? undefined}\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(searchAutocompleteStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n}\n\nlet SearchAutocompleteBase = React.forwardRef(ForwardSearchAutocompleteBase) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\n\ninterface SearchAutocompleteInputProps<T> extends SpectrumSearchAutocompleteProps<T> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean,\n clearButtonProps: AriaButtonProps\n}\n\n// any type is because we don't want to call useObjectRef because this is an internal component and we know\n// we are always passing an object ref\nfunction ForwardSearchAutocompleteInput<T>(props: SearchAutocompleteInputProps<T>, ref: any) {\n let searchIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = searchIcon,\n isQuiet,\n isDisabled,\n isReadOnly,\n validationState,\n inputProps,\n inputRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger,\n clearButtonProps\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let domProps = filterDOMProps(props);\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n ),\n classNames(\n searchStyles,\n 'spectrum-Search-circleLoader'\n )\n )} />\n );\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n timeout.current = null;\n }\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n searchAutocompleteStyles,\n 'searchautocomplete'\n ),\n className\n )\n }>\n <TextFieldBase\n {...domProps}\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-Search',\n 'spectrum-Search--loadable',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n )\n }\n inputClassName={classNames(searchStyles, 'spectrum-Search-input')}\n validationIconClassName={\n classNames(\n searchStyles,\n 'spectrum-Search-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n icon={icon}\n wrapperChildren={(inputValue !== '' || loadingState === 'filtering' || validationState != null) && !isReadOnly ? clearButton : undefined}\n disableFocusRing />\n </div>\n </FocusRing>)\n );\n}\n\nlet SearchAutocompleteInput = React.forwardRef(ForwardSearchAutocompleteInput) as <T>(props: SearchAutocompleteInputProps<T> & {ref?: any}) => ReactElement;\n\n\n/**\n * A SearchAutocomplete is a searchfield that supports a dynamic list of suggestions.\n */\nlet ForwardSearchAutocomplete = forwardRef(SearchAutocomplete) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {ForwardSearchAutocomplete as SearchAutocomplete};\n"],"names":[],"version":3,"file":"SearchAutocomplete.main.js.map"}
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AAC,aAAa,cAAc;QAC/H,kBAAA;;AAIV;AAEA,IAAI,8DAA0B,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;AAG/C;;CAEC,GACD,IAAI,0DAA4B,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/autocomplete/src/SearchAutocomplete.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 */\nimport {AriaButtonProps} from '@react-types/button';\nimport {classNames, dimensionValue, useFocusableRef, useIsMobileDevice, useResizeObserver, useUnwrapDOMRef} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {DOMRefValue, FocusableRef} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps, useLayoutEffect} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport {MobileSearchAutocomplete} from './MobileSearchAutocomplete';\nimport {Popover} from '@react-spectrum/overlays';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n forwardRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchAutocompleteStyles from './searchautocomplete.css';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {SpectrumSearchAutocompleteProps} from '@react-types/autocomplete';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\nimport {useSearchAutocomplete} from '@react-aria/autocomplete';\n\nfunction SearchAutocomplete<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile searchwithin\n return <MobileSearchAutocomplete {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <SearchAutocompleteBase {...props} ref={ref} />;\n }\n}\n\nfunction ForwardSearchAutocompleteBase<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n menuWidth: customMenuWidth,\n loadingState,\n onLoadMore,\n onSubmit = () => {},\n validate\n } = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync,\n allowsCustomValue: true,\n onSelectionChange: (key) => key !== null && onSubmit(null, key),\n selectedKey: undefined,\n defaultSelectedKey: undefined,\n validate: useCallback(v => validate?.(v.inputValue), [validate])\n }\n );\n let layout = useListBoxLayout();\n\n let {inputProps, listBoxProps, labelProps, clearButtonProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useSearchAutocomplete(\n {\n ...props,\n layoutDelegate: layout,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef,\n menuTrigger\n },\n state\n );\n\n // Measure the width of the inputfield to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number>(0);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (inputRef.current) {\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(inputWidth);\n }\n }, [inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n labelProps={labelProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n ref={domRef}>\n <SearchAutocompleteInput\n {...props}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n clearButtonProps={clearButtonProps}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)} />\n </Field>\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n autoFocus={state.focusStrategy ?? undefined}\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(searchAutocompleteStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n}\n\nlet SearchAutocompleteBase = React.forwardRef(ForwardSearchAutocompleteBase) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\n\ninterface SearchAutocompleteInputProps<T> extends SpectrumSearchAutocompleteProps<T> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean,\n clearButtonProps: AriaButtonProps\n}\n\n// any type is because we don't want to call useObjectRef because this is an internal component and we know\n// we are always passing an object ref\nfunction ForwardSearchAutocompleteInput<T>(props: SearchAutocompleteInputProps<T>, ref: any) {\n let searchIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = searchIcon,\n isQuiet,\n isDisabled,\n isReadOnly,\n validationState,\n inputProps,\n inputRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger,\n clearButtonProps\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let domProps = filterDOMProps(props);\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n ),\n classNames(\n searchStyles,\n 'spectrum-Search-circleLoader'\n )\n )} />\n );\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n timeout.current = null;\n }\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n searchAutocompleteStyles,\n 'searchautocomplete'\n ),\n className\n )\n }>\n <TextFieldBase\n {...domProps}\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-Search',\n 'spectrum-Search--loadable',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n )\n }\n inputClassName={classNames(searchStyles, 'spectrum-Search-input')}\n validationIconClassName={\n classNames(\n searchStyles,\n 'spectrum-Search-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n icon={icon}\n wrapperChildren={(inputValue !== '' || loadingState === 'filtering' || validationState != null) && !isReadOnly ? clearButton : undefined}\n disableFocusRing />\n </div>\n </FocusRing>)\n );\n}\n\nlet SearchAutocompleteInput = React.forwardRef(ForwardSearchAutocompleteInput) as <T>(props: SearchAutocompleteInputProps<T> & {ref?: any}) => ReactElement;\n\n\n/**\n * A SearchAutocomplete is a searchfield that supports a dynamic list of suggestions.\n */\nlet ForwardSearchAutocomplete = forwardRef(SearchAutocomplete) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {ForwardSearchAutocomplete as SearchAutocomplete};\n"],"names":[],"version":3,"file":"SearchAutocomplete.main.js.map"}
@@ -1,12 +1,12 @@
1
1
  import $fLcex$intlStringsmodulejs from "./intlStrings.mjs";
2
2
  import {MobileSearchAutocomplete as $c940f54e16bafef5$export$e7a90f7d6b078162} from "./MobileSearchAutocomplete.mjs";
3
- import "./searchautocomplete.af2b88b2.css";
3
+ import "./autocomplete.02db68b2.css";
4
4
  import $fLcex$searchautocomplete_cssmodulejs from "./searchautocomplete_css.mjs";
5
- import "./vars.3a478514.css";
5
+ import "./autocomplete.102c5c14.css";
6
6
  import $fLcex$search_vars_cssmodulejs from "./search_vars_css.mjs";
7
- import "./vars.02beaa3c.css";
7
+ import "./autocomplete.4eff7fc7.css";
8
8
  import $fLcex$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.mjs";
9
- import "./vars.8b5c28ea.css";
9
+ import "./autocomplete.30e64bfb.css";
10
10
  import $fLcex$textfield_vars_cssmodulejs from "./textfield_vars_css.mjs";
11
11
  import {useIsMobileDevice as $fLcex$useIsMobileDevice, useUnwrapDOMRef as $fLcex$useUnwrapDOMRef, useFocusableRef as $fLcex$useFocusableRef, useResizeObserver as $fLcex$useResizeObserver, dimensionValue as $fLcex$dimensionValue, classNames as $fLcex$classNames} from "@react-spectrum/utils";
12
12
  import {ClearButton as $fLcex$ClearButton} from "@react-spectrum/button";
@@ -66,7 +66,7 @@ function $parcel$interopDefault(a) {
66
66
  function $f3f3b62273a2d260$var$SearchAutocomplete(props, ref) {
67
67
  props = (0, $fLcex$useProviderProps)(props);
68
68
  props = (0, $fLcex$useFormProps)(props);
69
- if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');
69
+ if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');
70
70
  let isMobile = (0, $fLcex$useIsMobileDevice)();
71
71
  if (isMobile) // menuTrigger=focus/manual don't apply to mobile searchwithin
72
72
  return /*#__PURE__*/ (0, $fLcex$react).createElement((0, $c940f54e16bafef5$export$e7a90f7d6b078162), {
@@ -1,12 +1,12 @@
1
1
  import $fLcex$intlStringsmodulejs from "./intlStrings.module.js";
2
2
  import {MobileSearchAutocomplete as $c940f54e16bafef5$export$e7a90f7d6b078162} from "./MobileSearchAutocomplete.module.js";
3
- import "./searchautocomplete.af2b88b2.css";
3
+ import "./autocomplete.02db68b2.css";
4
4
  import $fLcex$searchautocomplete_cssmodulejs from "./searchautocomplete_css.module.js";
5
- import "./vars.3a478514.css";
5
+ import "./autocomplete.102c5c14.css";
6
6
  import $fLcex$search_vars_cssmodulejs from "./search_vars_css.module.js";
7
- import "./vars.02beaa3c.css";
7
+ import "./autocomplete.4eff7fc7.css";
8
8
  import $fLcex$inputgroup_vars_cssmodulejs from "./inputgroup_vars_css.module.js";
9
- import "./vars.8b5c28ea.css";
9
+ import "./autocomplete.30e64bfb.css";
10
10
  import $fLcex$textfield_vars_cssmodulejs from "./textfield_vars_css.module.js";
11
11
  import {useIsMobileDevice as $fLcex$useIsMobileDevice, useUnwrapDOMRef as $fLcex$useUnwrapDOMRef, useFocusableRef as $fLcex$useFocusableRef, useResizeObserver as $fLcex$useResizeObserver, dimensionValue as $fLcex$dimensionValue, classNames as $fLcex$classNames} from "@react-spectrum/utils";
12
12
  import {ClearButton as $fLcex$ClearButton} from "@react-spectrum/button";
@@ -66,7 +66,7 @@ function $parcel$interopDefault(a) {
66
66
  function $f3f3b62273a2d260$var$SearchAutocomplete(props, ref) {
67
67
  props = (0, $fLcex$useProviderProps)(props);
68
68
  props = (0, $fLcex$useFormProps)(props);
69
- if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');
69
+ if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');
70
70
  let isMobile = (0, $fLcex$useIsMobileDevice)();
71
71
  if (isMobile) // menuTrigger=focus/manual don't apply to mobile searchwithin
72
72
  return /*#__PURE__*/ (0, $fLcex$react).createElement((0, $c940f54e16bafef5$export$e7a90f7d6b078162), {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;AAsCD,SAAS,yCAAqC,KAAyC,EAAE,GAA8B;IACrH,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IAErB,IAAI,MAAM,WAAW,EACnB,QAAQ,IAAI,CAAC;IAGf,IAAI,WAAW,CAAA,GAAA,wBAAgB;IAC/B,IAAI,UACF,8DAA8D;IAC9D,qBAAO,gCAAC,CAAA,GAAA,yCAAuB;QAAG,GAAG,KAAK;QAAE,aAAY;QAAQ,KAAK;;SAErE,qBAAO,gCAAC;QAAwB,GAAG,KAAK;QAAE,KAAK;;AAEnD;AAEA,SAAS,oDAAgD,KAAyC,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B,uBAEF;qBAGJ,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,QAAQ;QACZ,YAAY;QACZ,UAAU;QACV,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAW,GACX,mBACA,6BACA,sBACA;YACE,eAAe;YACf,YAAY;YACZ,4BAA4B,oBAAoB,aAAa,CAAC;YAC9D,0BAA0B,oBAAoB,WAAW,CAAC;QAC5D,GACA,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,4DAAK,GACL;QAIN,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAW,GAAG;QACzC,yBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAW,GACX;QAGJ,YAAY;QACZ,SAAS;QACT,iBAAiB;QACjB,WAAW,eAAgB,CAAA,UAAU,gBAAgB,YAAY,iBAAiB,SAAQ;QAC1F,kBAAkB,gBAAgB,OAAO,gBAAgB;QACzD,MAAM;QACN,iBAAiB,AAAC,CAAA,eAAe,MAAM,iBAAiB,eAAe,mBAAmB,IAAG,KAAM,CAAC,aAAa,cAAc;QAC/H,kBAAA;;AAIV;AAEA,IAAI,8DAA0B,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;AAG/C;;CAEC,GACD,IAAI,0DAA4B,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/autocomplete/src/SearchAutocomplete.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 */\nimport {AriaButtonProps} from '@react-types/button';\nimport {classNames, dimensionValue, useFocusableRef, useIsMobileDevice, useResizeObserver, useUnwrapDOMRef} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {DOMRefValue, FocusableRef} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps, useLayoutEffect} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport {MobileSearchAutocomplete} from './MobileSearchAutocomplete';\nimport {Popover} from '@react-spectrum/overlays';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n forwardRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchAutocompleteStyles from './searchautocomplete.css';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {SpectrumSearchAutocompleteProps} from '@react-types/autocomplete';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\nimport {useSearchAutocomplete} from '@react-aria/autocomplete';\n\nfunction SearchAutocomplete<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile searchwithin\n return <MobileSearchAutocomplete {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <SearchAutocompleteBase {...props} ref={ref} />;\n }\n}\n\nfunction ForwardSearchAutocompleteBase<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n menuWidth: customMenuWidth,\n loadingState,\n onLoadMore,\n onSubmit = () => {},\n validate\n } = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync,\n allowsCustomValue: true,\n onSelectionChange: (key) => key !== null && onSubmit(null, key),\n selectedKey: undefined,\n defaultSelectedKey: undefined,\n validate: useCallback(v => validate?.(v.inputValue), [validate])\n }\n );\n let layout = useListBoxLayout();\n\n let {inputProps, listBoxProps, labelProps, clearButtonProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useSearchAutocomplete(\n {\n ...props,\n layoutDelegate: layout,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef,\n menuTrigger\n },\n state\n );\n\n // Measure the width of the inputfield to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number>(0);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (inputRef.current) {\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(inputWidth);\n }\n }, [inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n labelProps={labelProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n ref={domRef}>\n <SearchAutocompleteInput\n {...props}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n clearButtonProps={clearButtonProps}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)} />\n </Field>\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n autoFocus={state.focusStrategy ?? undefined}\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(searchAutocompleteStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n}\n\nlet SearchAutocompleteBase = React.forwardRef(ForwardSearchAutocompleteBase) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\n\ninterface SearchAutocompleteInputProps<T> extends SpectrumSearchAutocompleteProps<T> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean,\n clearButtonProps: AriaButtonProps\n}\n\n// any type is because we don't want to call useObjectRef because this is an internal component and we know\n// we are always passing an object ref\nfunction ForwardSearchAutocompleteInput<T>(props: SearchAutocompleteInputProps<T>, ref: any) {\n let searchIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = searchIcon,\n isQuiet,\n isDisabled,\n isReadOnly,\n validationState,\n inputProps,\n inputRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger,\n clearButtonProps\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let domProps = filterDOMProps(props);\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n ),\n classNames(\n searchStyles,\n 'spectrum-Search-circleLoader'\n )\n )} />\n );\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n timeout.current = null;\n }\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n searchAutocompleteStyles,\n 'searchautocomplete'\n ),\n className\n )\n }>\n <TextFieldBase\n {...domProps}\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-Search',\n 'spectrum-Search--loadable',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n )\n }\n inputClassName={classNames(searchStyles, 'spectrum-Search-input')}\n validationIconClassName={\n classNames(\n searchStyles,\n 'spectrum-Search-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n icon={icon}\n wrapperChildren={(inputValue !== '' || loadingState === 'filtering' || validationState != null) && !isReadOnly ? clearButton : undefined}\n disableFocusRing />\n </div>\n </FocusRing>)\n );\n}\n\nlet SearchAutocompleteInput = React.forwardRef(ForwardSearchAutocompleteInput) as <T>(props: SearchAutocompleteInputProps<T> & {ref?: any}) => ReactElement;\n\n\n/**\n * A SearchAutocomplete is a searchfield that supports a dynamic list of suggestions.\n */\nlet ForwardSearchAutocomplete = forwardRef(SearchAutocomplete) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {ForwardSearchAutocomplete as SearchAutocomplete};\n"],"names":[],"version":3,"file":"SearchAutocomplete.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;AAsCD,SAAS,yCAAqC,KAAyC,EAAE,GAA8B;IACrH,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IAErB,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,IAAI,WAAW,CAAA,GAAA,wBAAgB;IAC/B,IAAI,UACF,8DAA8D;IAC9D,qBAAO,gCAAC,CAAA,GAAA,yCAAuB;QAAG,GAAG,KAAK;QAAE,aAAY;QAAQ,KAAK;;SAErE,qBAAO,gCAAC;QAAwB,GAAG,KAAK;QAAE,KAAK;;AAEnD;AAEA,SAAS,oDAAgD,KAAyC,EAAE,GAA8B;IAChI,QAAQ,CAAA,GAAA,uBAAe,EAAE;IAEzB,IAAI,eACF,cAAc,qBACd,aAAa,iBACb,YAAY,iBACZ,QAAQ,kBACR,OAAO,EACP,WAAW,eAAe,gBAC1B,YAAY,cACZ,UAAU,YACV,WAAW,KAAO,aAClB,QAAQ,EACT,GAAG;IAEJ,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,UAAU,gBAAgB;IAC9B,IAAI,aAAa,CAAA,GAAA,aAAK,EAA+B;IACrD,IAAI,sBAAsB,CAAA,GAAA,sBAAc,EAAE;IAC1C,IAAI,aAAa,CAAA,GAAA,aAAK,EAAE;IACxB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE,KAAK;IAElC,IAAI,YAAC,QAAQ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AgB,OAAO,gBAAgB;QACzD,MAAM;QACN,iBAAiB,AAAC,CAAA,eAAe,MAAM,iBAAiB,eAAe,mBAAmB,IAAG,KAAM,CAAC,aAAa,cAAc;QAC/H,kBAAA;;AAIV;AAEA,IAAI,8DAA0B,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;AAG/C;;CAEC,GACD,IAAI,0DAA4B,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/autocomplete/src/SearchAutocomplete.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 */\nimport {AriaButtonProps} from '@react-types/button';\nimport {classNames, dimensionValue, useFocusableRef, useIsMobileDevice, useResizeObserver, useUnwrapDOMRef} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport {DOMRefValue, FocusableRef} from '@react-types/shared';\nimport {Field} from '@react-spectrum/label';\nimport {filterDOMProps, useLayoutEffect} from '@react-aria/utils';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListBoxBase, useListBoxLayout} from '@react-spectrum/listbox';\nimport Magnifier from '@spectrum-icons/ui/Magnifier';\nimport {MobileSearchAutocomplete} from './MobileSearchAutocomplete';\nimport {Popover} from '@react-spectrum/overlays';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {\n forwardRef,\n InputHTMLAttributes,\n ReactElement,\n RefObject,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport searchAutocompleteStyles from './searchautocomplete.css';\nimport searchStyles from '@adobe/spectrum-css-temp/components/search/vars.css';\nimport {SpectrumSearchAutocompleteProps} from '@react-types/autocomplete';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useComboBoxState} from '@react-stately/combobox';\nimport {useFilter, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useProvider, useProviderProps} from '@react-spectrum/provider';\nimport {useSearchAutocomplete} from '@react-aria/autocomplete';\n\nfunction SearchAutocomplete<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');\n }\n\n let isMobile = useIsMobileDevice();\n if (isMobile) {\n // menuTrigger=focus/manual don't apply to mobile searchwithin\n return <MobileSearchAutocomplete {...props} menuTrigger=\"input\" ref={ref} />;\n } else {\n return <SearchAutocompleteBase {...props} ref={ref} />;\n }\n}\n\nfunction ForwardSearchAutocompleteBase<T extends object>(props: SpectrumSearchAutocompleteProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n\n let {\n menuTrigger = 'input',\n shouldFlip = true,\n direction = 'bottom',\n align = 'start',\n isQuiet,\n menuWidth: customMenuWidth,\n loadingState,\n onLoadMore,\n onSubmit = () => {},\n validate\n } = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let isAsync = loadingState != null;\n let popoverRef = useRef<DOMRefValue<HTMLDivElement>>(null);\n let unwrappedPopoverRef = useUnwrapDOMRef(popoverRef);\n let listBoxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let {contains} = useFilter({sensitivity: 'base'});\n let state = useComboBoxState(\n {\n ...props,\n defaultFilter: contains,\n allowsEmptyCollection: isAsync,\n allowsCustomValue: true,\n onSelectionChange: (key) => key !== null && onSubmit(null, key),\n selectedKey: undefined,\n defaultSelectedKey: undefined,\n validate: useCallback(v => validate?.(v.inputValue), [validate])\n }\n );\n let layout = useListBoxLayout();\n\n let {inputProps, listBoxProps, labelProps, clearButtonProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useSearchAutocomplete(\n {\n ...props,\n layoutDelegate: layout,\n popoverRef: unwrappedPopoverRef,\n listBoxRef,\n inputRef,\n menuTrigger\n },\n state\n );\n\n // Measure the width of the inputfield to inform the width of the menu (below).\n let [menuWidth, setMenuWidth] = useState<number>(0);\n let {scale} = useProvider();\n\n let onResize = useCallback(() => {\n if (inputRef.current) {\n let inputWidth = inputRef.current.offsetWidth;\n setMenuWidth(inputWidth);\n }\n }, [inputRef, setMenuWidth]);\n\n useResizeObserver({\n ref: domRef,\n onResize: onResize\n });\n\n useLayoutEffect(onResize, [scale, onResize]);\n\n let width = isQuiet ? undefined : menuWidth;\n let style = {\n width: customMenuWidth ? dimensionValue(customMenuWidth) : width,\n minWidth: isQuiet ? `calc(${menuWidth}px + calc(2 * var(--spectrum-dropdown-quiet-offset)))` : menuWidth\n };\n\n return (\n <>\n <Field\n {...props}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n labelProps={labelProps}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n ref={domRef}>\n <SearchAutocompleteInput\n {...props}\n isOpen={state.isOpen}\n loadingState={loadingState}\n inputProps={inputProps}\n inputRef={inputRef}\n clearButtonProps={clearButtonProps}\n validationState={props.validationState || (isInvalid ? 'invalid' : undefined)} />\n </Field>\n <Popover\n state={state}\n UNSAFE_style={style}\n UNSAFE_className={classNames(styles, 'spectrum-InputGroup-popover', {'spectrum-InputGroup-popover--quiet': isQuiet})}\n ref={popoverRef}\n triggerRef={inputRef}\n placement={`${direction} ${align}`}\n hideArrow\n isNonModal\n shouldFlip={shouldFlip}>\n <ListBoxBase\n {...listBoxProps}\n ref={listBoxRef}\n disallowEmptySelection\n autoFocus={state.focusStrategy ?? undefined}\n shouldSelectOnPressUp\n focusOnPointerEnter\n layout={layout}\n state={state}\n shouldUseVirtualFocus\n isLoading={loadingState === 'loading' || loadingState === 'loadingMore'}\n showLoadingSpinner={loadingState === 'loadingMore'}\n onLoadMore={onLoadMore}\n renderEmptyState={() => isAsync && (\n <span className={classNames(searchAutocompleteStyles, 'no-results')}>\n {stringFormatter.format('noResults')}\n </span>\n )} />\n </Popover>\n </>\n );\n}\n\nlet SearchAutocompleteBase = React.forwardRef(ForwardSearchAutocompleteBase) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\n\n\ninterface SearchAutocompleteInputProps<T> extends SpectrumSearchAutocompleteProps<T> {\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n inputRef: RefObject<HTMLInputElement | null>,\n style?: React.CSSProperties,\n className?: string,\n isOpen?: boolean,\n clearButtonProps: AriaButtonProps\n}\n\n// any type is because we don't want to call useObjectRef because this is an internal component and we know\n// we are always passing an object ref\nfunction ForwardSearchAutocompleteInput<T>(props: SearchAutocompleteInputProps<T>, ref: any) {\n let searchIcon = (\n <Magnifier data-testid=\"searchicon\" />\n );\n\n let {\n icon = searchIcon,\n isQuiet,\n isDisabled,\n isReadOnly,\n validationState,\n inputProps,\n inputRef,\n autoFocus,\n style,\n className,\n loadingState,\n isOpen,\n menuTrigger,\n clearButtonProps\n } = props;\n let {hoverProps, isHovered} = useHover({});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/autocomplete');\n let domProps = filterDOMProps(props);\n let timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n let [showLoading, setShowLoading] = useState(false);\n\n let loadingCircle = (\n <ProgressCircle\n aria-label={stringFormatter.format('loading')}\n size=\"S\"\n isIndeterminate\n UNSAFE_className={classNames(\n textfieldStyles,\n 'spectrum-Textfield-circleLoader',\n classNames(\n styles,\n 'spectrum-InputGroup-input-circleLoader'\n ),\n classNames(\n searchStyles,\n 'spectrum-Search-circleLoader'\n )\n )} />\n );\n\n let clearButton = (\n <ClearButton\n {...clearButtonProps}\n preventFocus\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-ClearButton'\n )\n }\n isDisabled={isDisabled} />\n );\n\n let isLoading = loadingState === 'loading' || loadingState === 'filtering';\n let inputValue = inputProps.value;\n let lastInputValue = useRef(inputValue);\n useEffect(() => {\n if (isLoading && !showLoading) {\n if (timeout.current === null) {\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n\n // If user is typing, clear the timer and restart since it is a new request\n if (inputValue !== lastInputValue.current) {\n clearTimeout(timeout.current);\n timeout.current = setTimeout(() => {\n setShowLoading(true);\n }, 500);\n }\n } else if (!isLoading) {\n // If loading is no longer happening, clear any timers and hide the loading circle\n setShowLoading(false);\n if (timeout.current != null) {\n clearTimeout(timeout.current);\n timeout.current = null;\n }\n }\n\n lastInputValue.current = inputValue;\n }, [isLoading, showLoading, inputValue]);\n\n return (\n (<FocusRing\n within\n isTextInput\n focusClass={classNames(styles, 'is-focused')}\n focusRingClass={classNames(styles, 'focus-ring')}\n autoFocus={autoFocus}>\n <div\n {...hoverProps}\n ref={ref as RefObject<HTMLDivElement | null>}\n style={style}\n className={\n classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'is-disabled': isDisabled,\n 'spectrum-InputGroup--invalid': validationState === 'invalid' && !isDisabled,\n 'is-hovered': isHovered\n },\n classNames(\n searchAutocompleteStyles,\n 'searchautocomplete'\n ),\n className\n )\n }>\n <TextFieldBase\n {...domProps}\n inputProps={inputProps}\n inputRef={inputRef}\n UNSAFE_className={\n classNames(\n searchStyles,\n 'spectrum-Search',\n 'spectrum-Search--loadable',\n 'spectrum-Textfield',\n {\n 'is-disabled': isDisabled,\n 'is-quiet': isQuiet,\n 'spectrum-Search--invalid': validationState === 'invalid' && !isDisabled,\n 'spectrum-Search--valid': validationState === 'valid' && !isDisabled\n },\n classNames(\n styles,\n 'spectrum-InputGroup-field'\n )\n )\n }\n inputClassName={classNames(searchStyles, 'spectrum-Search-input')}\n validationIconClassName={\n classNames(\n searchStyles,\n 'spectrum-Search-validationIcon'\n )\n }\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n isLoading={showLoading && (isOpen || menuTrigger === 'manual' || loadingState === 'loading')}\n loadingIndicator={loadingState != null ? loadingCircle : undefined}\n icon={icon}\n wrapperChildren={(inputValue !== '' || loadingState === 'filtering' || validationState != null) && !isReadOnly ? clearButton : undefined}\n disableFocusRing />\n </div>\n </FocusRing>)\n );\n}\n\nlet SearchAutocompleteInput = React.forwardRef(ForwardSearchAutocompleteInput) as <T>(props: SearchAutocompleteInputProps<T> & {ref?: any}) => ReactElement;\n\n\n/**\n * A SearchAutocomplete is a searchfield that supports a dynamic list of suggestions.\n */\nlet ForwardSearchAutocomplete = forwardRef(SearchAutocomplete) as <T>(props: SpectrumSearchAutocompleteProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {ForwardSearchAutocomplete as SearchAutocomplete};\n"],"names":[],"version":3,"file":"SearchAutocomplete.module.js.map"}
@@ -52,4 +52,4 @@
52
52
  flex: 1;
53
53
  width: 100%;
54
54
  }
55
- /*# sourceMappingURL=searchautocomplete.af2b88b2.css.map */
55
+ /*# sourceMappingURL=autocomplete.02db68b2.css.map */
@@ -1 +1 @@
1
- {"mappings":"AAYA;;;;;;;;AAcA;;;;;AAKA;;;;AAIA;;;;;AAKA;;;;;;AAMA;;;;;;;AAOA;;;;;;;AAME;;;;AAIA;;;;AAKF","sources":["packages/@react-spectrum/autocomplete/src/searchautocomplete.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.no-results {\n display: block;\n /*\n Renamed from padding-y to padding-height to fix docs issue where fallback var replaced this value\n (due to old spectrum-css postcss-custom-properties-custom-mapping plugin).\n */\n padding-top: var(--spectrum-selectlist-option-padding-height);\n padding-inline-start: var(--spectrum-selectlist-option-padding);\n font-size: var(--spectrum-selectlist-option-text-size);\n font-weight: var(--spectrum-selectlist-option-text-font-weight);\n}\n\n/* override .spectrum-InputGroup */\n.searchautocomplete.searchautocomplete {\n border-radius: var(--spectrum-search-border-radius);\n --spectrum-focus-ring-border-radius: var(--spectrum-search-border-radius);\n}\n\n.mobile-searchautocomplete {\n outline: none;\n}\n\n.mobile-input {\n display: flex;\n align-items: center;\n}\n\n.mobile-value {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.tray-dialog {\n display: flex;\n flex-direction: column;\n height: 100%;\n outline: none;\n}\n\n.tray-textfield {\n margin: var(--spectrum-global-dimension-size-150);\n margin-bottom: var(--spectrum-global-dimension-size-50);\n flex-shrink: 0;\n width: initial !important;\n\n &.has-label {\n margin-top: var(--spectrum-global-dimension-size-50);\n }\n\n .tray-textfield-input {\n padding-inline-start: var(--spectrum-textfield-padding-x);\n }\n}\n\n.tray-listbox {\n width: 100%;\n flex: 1;\n}\n"],"names":[],"version":3,"file":"searchautocomplete.af2b88b2.css.map"}
1
+ {"mappings":"AAYA;;;;;;;;AAcA;;;;;AAKA;;;;AAIA;;;;;AAKA;;;;;;AAMA;;;;;;;AAOA;;;;;;;AAME;;;;AAIA;;;;AAKF","sources":["packages/@react-spectrum/autocomplete/src/searchautocomplete.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.no-results {\n display: block;\n /*\n Renamed from padding-y to padding-height to fix docs issue where fallback var replaced this value\n (due to old spectrum-css postcss-custom-properties-custom-mapping plugin).\n */\n padding-top: var(--spectrum-selectlist-option-padding-height);\n padding-inline-start: var(--spectrum-selectlist-option-padding);\n font-size: var(--spectrum-selectlist-option-text-size);\n font-weight: var(--spectrum-selectlist-option-text-font-weight);\n}\n\n/* override .spectrum-InputGroup */\n.searchautocomplete.searchautocomplete {\n border-radius: var(--spectrum-search-border-radius);\n --spectrum-focus-ring-border-radius: var(--spectrum-search-border-radius);\n}\n\n.mobile-searchautocomplete {\n outline: none;\n}\n\n.mobile-input {\n display: flex;\n align-items: center;\n}\n\n.mobile-value {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.tray-dialog {\n display: flex;\n flex-direction: column;\n height: 100%;\n outline: none;\n}\n\n.tray-textfield {\n margin: var(--spectrum-global-dimension-size-150);\n margin-bottom: var(--spectrum-global-dimension-size-50);\n flex-shrink: 0;\n width: initial !important;\n\n &.has-label {\n margin-top: var(--spectrum-global-dimension-size-50);\n }\n\n .tray-textfield-input {\n padding-inline-start: var(--spectrum-textfield-padding-x);\n }\n}\n\n.tray-listbox {\n width: 100%;\n flex: 1;\n}\n"],"names":[],"version":3,"file":"autocomplete.02db68b2.css.map"}
@@ -220,4 +220,4 @@
220
220
  ._7mdQq_spectrum-Textfield._7mdQq_spectrum-Search--valid ._7mdQq_spectrum-Search-input._7mdQq_spectrum-Search-input, ._7mdQq_spectrum-Textfield._7mdQq_spectrum-Search--loadable ._7mdQq_spectrum-Search-input._7mdQq_spectrum-Search-input {
221
221
  padding-inline-end: calc(var(--spectrum-global-dimension-size-350) + var(--spectrum-textfield-padding-x, var(--spectrum-global-dimension-size-150)) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-textfield-icon-margin-left, var(--spectrum-global-dimension-size-150)));
222
222
  }
223
- /*# sourceMappingURL=vars.3a478514.css.map */
223
+ /*# sourceMappingURL=autocomplete.102c5c14.css.map */
@@ -1 +1 @@
1
- {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAQJ;;;;;AAIE;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAYA;;;;AAIA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAIA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAMF;;;;;;;;AAgBE;;;;AAAA;;;;AAKA;;;;AAIA","sources":["packages/@adobe/spectrum-css-temp/components/search/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"],"names":[],"version":3,"file":"vars.3a478514.css.map"}
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAQJ;;;;;AAIE;;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAYA;;;;AAIA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAIA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAMF;;;;;;;;AAgBE;;;;AAAA;;;;AAKA;;;;AAIA","sources":["packages/@adobe/spectrum-css-temp/components/search/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"],"names":[],"version":3,"file":"autocomplete.102c5c14.css.map"}
@@ -547,4 +547,4 @@
547
547
  border-color: var(--spectrum-textfield-quiet-border-color-key-focus, var(--spectrum-alias-border-color-focus));
548
548
  }
549
549
  }
550
- /*# sourceMappingURL=vars.8b5c28ea.css.map */
550
+ /*# sourceMappingURL=autocomplete.30e64bfb.css.map */
@@ -1 +1 @@
1
- {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;AAQE;;;;;;AAWF;;;;;;;;;;;;;;;;;;;;AA4CE;;;;;;;;AAYA;;;;;;;AAWE;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAMA;;;;AAKF;;;;;AAME;;;;AAQF;;;;;AAOA;;;;;AAAA;;;;;AAOA;;;;AAIA;;;;;;;;AAUA;;;;;;;AASA;;;;AAIA;;;;AASF;;;;AAIA;;;;;AAKE;;;;AAIA;;;;;AAME;;;;AAOJ;;;;;;;;AAUE;;;;AAKF;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOA;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASA;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAaA;;;;AASE;;;;AAIE;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKF;;;;;AAQF;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAME;;;;AAiBF;;;;;;AAKE;;;;AAKA;;;;;AAIE;;;;AAMF;;;;;;AAKE;;;;AAMF;;;;AAME;;;;;AAMF;;;;;;;AASE;;;;AAKA;;;;AAdF;;;;;;;AASE;;;;AAKA;;;;AAKF;;;;AAGE;;;;AAcE;;;;;AAOJ;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAME;;;;;AAMF;;;;;AAOF;;;;AAGE;;;;AAIA;;;;AAIA;;;;AAME;;;;;AASA;;;;AASJ;;;;AAIA;;;;AAKF;EACE;;;;;;;;;;;;EAUE;;;;;EAKE;;;;;;EAKE","sources":["packages/@adobe/spectrum-css-temp/components/textfield/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.8b5c28ea.css.map"}
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;AAQE;;;;;;AAWF;;;;;;;;;;;;;;;;;;;;AA4CE;;;;;;;;AAYA;;;;;;;AAWE;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAJA;;;;AAIA;;;;AAMA;;;;AAKF;;;;;AAME;;;;AAQF;;;;;AAOA;;;;;AAAA;;;;;AAOA;;;;AAIA;;;;;;;;AAUA;;;;;;;AASA;;;;AAIA;;;;AASF;;;;AAIA;;;;;AAKE;;;;AAIA;;;;;AAME;;;;AAOJ;;;;;;;;AAUE;;;;AAKF;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOA;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASA;;;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAaA;;;;AASE;;;;AAIE;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKF;;;;;AAQF;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAME;;;;AAiBF;;;;;;AAKE;;;;AAKA;;;;;AAIE;;;;AAMF;;;;;;AAKE;;;;AAMF;;;;AAME;;;;;AAMF;;;;;;;AASE;;;;AAKA;;;;AAdF;;;;;;;AASE;;;;AAKA;;;;AAKF;;;;AAGE;;;;AAcE;;;;;AAOJ;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAME;;;;;AAMF;;;;;AAOF;;;;AAGE;;;;AAIA;;;;AAIA;;;;AAME;;;;;AASA;;;;AASJ;;;;AAIA;;;;AAKF;EACE;;;;;;;;;;;;EAUE;;;;;EAKE;;;;;;EAKE","sources":["packages/@adobe/spectrum-css-temp/components/textfield/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":"autocomplete.30e64bfb.css.map"}
@@ -646,4 +646,4 @@
646
646
  box-shadow: 0 2px 0 0 var(--spectrum-dropdown-border-color-key-focus, var(--spectrum-alias-border-color-focus));
647
647
  }
648
648
  }
649
- /*# sourceMappingURL=vars.02beaa3c.css.map */
649
+ /*# sourceMappingURL=autocomplete.4eff7fc7.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;;;;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAaE;;;;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAaA;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AASA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AASA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOJ;;;;AAMA;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAMA;;;;;AAME;;;;;;;AAOE;;;;;;;AAQA;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASF;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKE;;;;AAMA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOJ;;;;;AAMA;;;;AAGE;;;;AASE;;;;;AAMF;;;;;;AAME;;;;;AAKA;;;;AAKA;;;;;;;AAQF;;;;;;;;AAME;;;;;;;;;;AAYA;;;;;;;AAYE;;;;;AAMA;;;;AAmBN;;;;;AAKI;;;;AAWE;;;;AAcA;;;;AAWF;;;;AAOE;;;;AAOA;;;;AASA;;;;AAQJ;;;;AAgBA;;;;AAKF;;;;AAQM;;;;AAqBA;;;;AAgBA;;;;AAQA;;;;AAME;;;;AAOA;;;;AAQF;;;;AAgBF;;;;AAMA;;;;AAMF;;;;AAGE;;;;AAUA;;;;AAME;;;;AACE;;;;AAOF;;;;AAIE;;;;;AAQJ;;;;AAII;;;;AAEE;;;;AAIE;;;;AAKJ;;;;AAQR;EACE;;;;;;;;;;;;;;;;EAeE;;;;;;EAKA;;;;;;;;;;;;;;;;EAiBE;;;;EAeI;;;;EAQF;;;;EAQF;;;;EAIF;;;;EAuBE;;;;EAGA","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/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.02beaa3c.css.map"}
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;AAWE;;;;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAAA;;;;;;;AAaE;;;;;;;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAaA;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AASA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AASA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOJ;;;;AAMA;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAAA;;;;;AAMA;;;;;AAME;;;;;;;AAOE;;;;;;;AAQA;;;;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AASF;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKE;;;;AAMA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAKA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAAA;;;;AAOJ;;;;;AAMA;;;;AAGE;;;;AASE;;;;;AAMF;;;;;;AAME;;;;;AAKA;;;;AAKA;;;;;;;AAQF;;;;;;;;AAME;;;;;;;;;;AAYA;;;;;;;AAYE;;;;;AAMA;;;;AAmBN;;;;;AAKI;;;;AAWE;;;;AAcA;;;;AAWF;;;;AAOE;;;;AAOA;;;;AASA;;;;AAQJ;;;;AAgBA;;;;AAKF;;;;AAQM;;;;AAqBA;;;;AAgBA;;;;AAQA;;;;AAME;;;;AAOA;;;;AAQF;;;;AAgBF;;;;AAMA;;;;AAMF;;;;AAGE;;;;AAUA;;;;AAME;;;;AACE;;;;AAOF;;;;AAIE;;;;;AAQJ;;;;AAII;;;;AAEE;;;;AAIE;;;;AAKJ;;;;AAQR;EACE;;;;;;;;;;;;;;;;EAeE;;;;;;EAKA;;;;;;;;;;;;;;;;EAiBE;;;;EAeI;;;;EAQF;;;;EAQF;;;;EAIF;;;;EAuBE;;;;EAGA","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/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":"autocomplete.4eff7fc7.css.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/autocomplete",
3
- "version": "3.0.0-alpha.41",
3
+ "version": "3.0.0-alpha.42",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,30 +36,30 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/autocomplete": "3.0.0-beta.1",
40
- "@react-aria/button": "^3.12.1",
41
- "@react-aria/dialog": "^3.5.23",
42
- "@react-aria/focus": "^3.20.1",
43
- "@react-aria/form": "^3.0.14",
44
- "@react-aria/i18n": "^3.12.7",
45
- "@react-aria/interactions": "^3.24.1",
46
- "@react-aria/label": "^3.7.16",
47
- "@react-aria/overlays": "^3.26.1",
48
- "@react-aria/utils": "^3.28.1",
49
- "@react-spectrum/button": "^3.16.12",
50
- "@react-spectrum/form": "^3.7.13",
51
- "@react-spectrum/label": "^3.16.13",
52
- "@react-spectrum/listbox": "^3.14.3",
53
- "@react-spectrum/overlays": "^5.7.3",
54
- "@react-spectrum/progress": "^3.7.14",
55
- "@react-spectrum/textfield": "^3.13.1",
56
- "@react-spectrum/utils": "^3.12.3",
57
- "@react-stately/collections": "^3.12.2",
58
- "@react-stately/combobox": "^3.10.3",
59
- "@react-types/autocomplete": "3.0.0-alpha.29",
60
- "@react-types/button": "^3.11.0",
61
- "@react-types/shared": "^3.28.0",
62
- "@spectrum-icons/ui": "^3.6.14",
39
+ "@react-aria/autocomplete": "3.0.0-beta.2",
40
+ "@react-aria/button": "^3.13.0",
41
+ "@react-aria/dialog": "^3.5.24",
42
+ "@react-aria/focus": "^3.20.2",
43
+ "@react-aria/form": "^3.0.15",
44
+ "@react-aria/i18n": "^3.12.8",
45
+ "@react-aria/interactions": "^3.25.0",
46
+ "@react-aria/label": "^3.7.17",
47
+ "@react-aria/overlays": "^3.27.0",
48
+ "@react-aria/utils": "^3.28.2",
49
+ "@react-spectrum/button": "^3.16.13",
50
+ "@react-spectrum/form": "^3.7.14",
51
+ "@react-spectrum/label": "^3.16.14",
52
+ "@react-spectrum/listbox": "^3.15.0",
53
+ "@react-spectrum/overlays": "^5.7.4",
54
+ "@react-spectrum/progress": "^3.7.15",
55
+ "@react-spectrum/textfield": "^3.13.2",
56
+ "@react-spectrum/utils": "^3.12.4",
57
+ "@react-stately/collections": "^3.12.3",
58
+ "@react-stately/combobox": "^3.10.4",
59
+ "@react-types/autocomplete": "3.0.0-alpha.30",
60
+ "@react-types/button": "^3.12.0",
61
+ "@react-types/shared": "^3.29.0",
62
+ "@spectrum-icons/ui": "^3.6.15",
63
63
  "@swc/helpers": "^0.5.0"
64
64
  },
65
65
  "devDependencies": {
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "9c4ebbc0c1972cc880febc29de995ca58caa3ba4"
76
+ "gitHead": "9b66d270572f482948afee95622a85cdf68ed408"
77
77
  }
@@ -50,7 +50,7 @@ function SearchAutocomplete<T extends object>(props: SpectrumSearchAutocompleteP
50
50
  props = useProviderProps(props);
51
51
  props = useFormProps(props);
52
52
 
53
- if (props.placeholder) {
53
+ if (props.placeholder && process.env.NODE_ENV !== 'production') {
54
54
  console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead.');
55
55
  }
56
56