/*
* Portions of this file are based on code from react-spectrum.
* Apache License Version 2.0, Copyright 2020 Adobe.
*
* Credits to the React Spectrum team:
* https://github.com/adobe/react-spectrum/blob/ba727bdc0c4a57626131e84d9c9b661d0b65b754/packages/@react-stately/combobox/src/useComboBoxState.ts
* https://github.com/adobe/react-spectrum/blob/ba727bdc0c4a57626131e84d9c9b661d0b65b754/packages/@react-aria/combobox/src/useComboBox.ts
*/
import {
type ValidationState,
access,
createGenerateId,
focusWithoutScrolling,
isAppleDevice,
isFunction,
mergeDefaultProps,
} from "@kobalte/utils";
import {
type Accessor,
type Component,
type JSX,
type ValidComponent,
createEffect,
createMemo,
createSignal,
createUniqueId,
on,
splitProps,
} from "solid-js";
import createPresence from "solid-presence";
import {
FORM_CONTROL_PROP_NAMES,
FormControlContext,
type FormControlDataSet,
createFormControl,
} from "../form-control";
import { createFilter } from "../i18n";
import { ListKeyboardDelegate, createListState } from "../list";
import { announce } from "../live-announcer";
import {
type ElementOf,
Polymorphic,
type PolymorphicProps,
} from "../polymorphic";
import { Popper, type PopperRootOptions } from "../popper";
import {
type CollectionNode,
createControllableSignal,
createDisclosureState,
createFormResetListener,
createRegisterId,
getItemCount,
} from "../primitives";
import {
type FocusStrategy,
type KeyboardDelegate,
Selection,
type SelectionBehavior,
type SelectionMode,
createSelectableCollection,
} from "../selection";
import {
ComboboxContext,
type ComboboxContextValue,
type ComboboxDataSet,
} from "./combobox-context";
import {
COMBOBOX_INTL_TRANSLATIONS,
type ComboboxIntlTranslations,
} from "./combobox.intl";
import type { ComboboxTriggerMode } from "./types";
export interface ComboboxBaseItemComponentProps