@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
42 lines (41 loc) • 1.66 kB
JavaScript
"use client";
import { useProps } from "../../../core/MantineProvider/use-props/use-props.mjs";
import { factory } from "../../../core/factory/factory.mjs";
import { Input } from "../../Input/Input.mjs";
import Combobox_module_default from "../Combobox.module.mjs";
import { useComboboxContext } from "../Combobox.context.mjs";
import { useComboboxTargetProps } from "../use-combobox-target-props/use-combobox-target-props.mjs";
import { useMergedRef } from "@mantine/hooks";
import { jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Combobox/ComboboxSearch/ComboboxSearch.tsx
const defaultProps = {
withAriaAttributes: true,
withKeyboardNavigation: true
};
const ComboboxSearch = factory((_props) => {
const { classNames, styles, unstyled, vars, withAriaAttributes, onKeyDown, withKeyboardNavigation, size, ref, ...others } = useProps("ComboboxSearch", defaultProps, _props);
const ctx = useComboboxContext();
const _styles = ctx.getStyles("search");
const targetProps = useComboboxTargetProps({
targetType: "input",
withAriaAttributes,
withKeyboardNavigation,
withExpandedAttribute: false,
onKeyDown,
autoComplete: "off"
});
return /* @__PURE__ */ jsx(Input, {
ref: useMergedRef(ref, ctx.store.searchRef),
classNames: [{ input: _styles.className }, classNames],
styles: [{ input: _styles.style }, styles],
size: size || ctx.size,
...targetProps,
...others,
__staticSelector: "Combobox"
});
});
ComboboxSearch.classes = Combobox_module_default;
ComboboxSearch.displayName = "@mantine/core/ComboboxSearch";
//#endregion
export { ComboboxSearch };
//# sourceMappingURL=ComboboxSearch.mjs.map