import { ListboxButton } from '@headlessui/react';
import mergeProps from 'merge-props';
import { useContext } from 'react';
import { PolymorphicWithOverrides } from '../../../common/polymorphicWithOverrides/PolymorphicWithOverrides.mjs';
import { SelectInputTriggerButtonPropsContext } from '../SelectInput.contexts.mjs';
import { jsx } from 'react/jsx-runtime';

function SelectInputTriggerButton({
  as = 'button',
  ...restProps
}) {
  const {
    ref,
    onClick,
    onKeyDown,
    size,
    ...interactionProps
  } = useContext(SelectInputTriggerButtonPropsContext);
  return /*#__PURE__*/jsx(ListboxButton, {
    ref: ref,
    as: PolymorphicWithOverrides,
    role: "combobox",
    __overrides: {
      as,
      size,
      ...interactionProps
    },
    ...mergeProps({
      onClick,
      onKeyDown
    }, restProps)
  });
}

export { SelectInputTriggerButton };
//# sourceMappingURL=SelectInputTriggerButton.mjs.map
