import React, { useMemo } from 'react';
import { useListNavigation } from './use-list-navigation';
import { jsx as _jsx } from "react/jsx-runtime";
export const ListNavigationContext = /*#__PURE__*/React.createContext({
  focused: null,
  lastFocused: null,
  lastFocusedIsPresent: false,
  selected: [],
  items: [],
  setItems: () => {},
  isDisabled: false,
  itemsMap: new Map(),
  refs: {
    current: new Map()
  },
  toggleSelected: () => {},
  setFocused: () => {},
  setBlurred: () => {},
  listId: 0
});
let uniqueListId = 0;
export const ListNavigationProvider = ({
  children,
  adapter,
  list,
  container,
  isDisabled = false
}) => {
  const listId = useMemo(() => uniqueListId++, []);
  const navigation = useListNavigation({
    adapter,
    list,
    isDisabled,
    container,
    listId
  });
  return /*#__PURE__*/_jsx(ListNavigationContext.Provider, {
    value: navigation,
    children: children
  });
};