Bin
2025-12-17 dcf780a91c16b6be28635b6e2e0e702060ee19f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import React, { type MutableRefObject, type RefObject } from "react";
import type { DropdownRef } from "./dropdown";
 
export interface DropdownContextValue {
  triggerRef: MutableRefObject<HTMLElement | undefined>;
  dropdown: RefObject<DropdownRef>;
  minIndex: number;
  hasTarget(target: HTMLElement): boolean;
  addChild(child: DropdownContextValue): void;
  removeChild(child: DropdownContextValue): void;
  open(): void;
  close(): void;
}
 
export const DropdownContext = React.createContext<DropdownContextValue | null>(null);