react-aria-components
Version:
A library of styleable components built using React Aria
69 lines (59 loc) • 3.56 kB
JavaScript
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
import {SearchFieldContext as $440f4836bcb56932$export$d1c4e4c63cb03a11} from "./SearchField.mjs";
import {TextFieldContext as $bcdf0525bf22703d$export$2129e27b3ef0d483} from "./TextField.mjs";
import {UNSTABLE_useAutocomplete as $llkzs$UNSTABLE_useAutocomplete} from "@react-aria/autocomplete";
import {UNSTABLE_useAutocompleteState as $llkzs$UNSTABLE_useAutocompleteState} from "@react-stately/autocomplete";
import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$useRef} from "react";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $d2f53cda644affe3$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $llkzs$createContext)(null);
const $d2f53cda644affe3$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$4581e569cc48eb6b, props.slot);
props = (0, $llkzs$mergeProps)(ctx, props);
let { filter: filter } = props;
let state = (0, $llkzs$UNSTABLE_useAutocompleteState)(props);
let collectionRef = (0, $llkzs$useRef)(null);
let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $llkzs$UNSTABLE_useAutocomplete)({
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
filter: filter,
collectionRef: collectionRef
}, state);
return /*#__PURE__*/ (0, $llkzs$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
values: [
[
$d2f53cda644affe3$export$879ad50d6ce9688,
state
],
[
(0, $440f4836bcb56932$export$d1c4e4c63cb03a11),
textFieldProps
],
[
(0, $bcdf0525bf22703d$export$2129e27b3ef0d483),
textFieldProps
],
[
$d2f53cda644affe3$export$65d2a03b8800d6e3,
{
filterFn: filterFn,
collectionProps: collectionProps,
collectionRef: mergedCollectionRef
}
]
]
}, props.children);
}
export {$d2f53cda644affe3$export$4581e569cc48eb6b as UNSTABLE_AutocompleteContext, $d2f53cda644affe3$export$879ad50d6ce9688 as UNSTABLE_AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$d834fde4e1147cd8 as UNSTABLE_Autocomplete};
//# sourceMappingURL=Autocomplete.module.js.map