import { useContext } from 'react';
import { clsx } from 'clsx';
import Button$1 from '../../button/Button.resolver.mjs';
import { useListItemControl } from '../useListItemControl.mjs';
import { ListItemContext } from '../ListItemContext.mjs';
import { jsx } from 'react/jsx-runtime';

const Button = ({
  priority = 'secondary-neutral',
  partiallyInteractive,
  ...props
}) => {
  const {
    baseItemProps
  } = useListItemControl('button', {
    partiallyInteractive,
    ...props
  });
  const {
    ids,
    describedByIds
  } = useContext(ListItemContext);
  const commonProps = {
    ...props,
    className: clsx('wds-list-item-control', !partiallyInteractive && props.href && 'wds-list-item-control_pseudo-element'),
    id: ids.control,
    priority,
    v2: true,
    size: 'sm',
    disabled: baseItemProps.disabled
  };
  const buttonContentId = props.href || partiallyInteractive ? '' : `${ids.control}_content`;
  return /*#__PURE__*/jsx(Button$1, {
    "aria-describedby": `${buttonContentId} ${describedByIds}`,
    ...commonProps
  });
};
Button.displayName = 'ListItem.Button';

export { Button };
//# sourceMappingURL=ListItemButton.mjs.map
