import { ChevronDown } from '@transferwise/icons';
import { clsx } from 'clsx';
import 'react';
import { InputGroup } from '../../InputGroup.mjs';
import { SelectInputClearButton } from '../ClearButton/SelectInputClearButton.mjs';
import { SelectInputTriggerButton } from '../TriggerButton/SelectInputTriggerButton.mjs';
import { SelectInputButtonInput } from '../ButtonInput/SelectInputButtonInput.mjs';
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';

function SelectInputDefaultRenderTrigger({
  content,
  placeholderShown,
  clear,
  disabled,
  size,
  className
}) {
  return /*#__PURE__*/jsx(InputGroup, {
    addonEnd: {
      content: /*#__PURE__*/jsxs("span", {
        className: clsx('np-select-input-addon-container', disabled && 'disabled'),
        children: [clear != null && !placeholderShown ? /*#__PURE__*/jsxs(Fragment, {
          children: [/*#__PURE__*/jsx(SelectInputClearButton, {
            onClick: event => {
              event.preventDefault();
              clear();
            }
          }), /*#__PURE__*/jsx("span", {
            className: "np-select-input-addon-separator"
          })]
        }) : null, /*#__PURE__*/jsx("span", {
          className: "np-select-input-addon",
          children: /*#__PURE__*/jsx(ChevronDown, {
            size: 16
          })
        })]
      }),
      initialContentWidth: 24 + 4,
      padding: 'sm'
    },
    disabled: disabled,
    className: className,
    children: /*#__PURE__*/jsx(SelectInputTriggerButton, {
      as: SelectInputButtonInput,
      size: size,
      children: /*#__PURE__*/jsx("span", {
        className: clsx('np-select-input-content', placeholderShown && 'np-select-input-placeholder'),
        children: content
      })
    })
  });
}
const DefaultRenderTrigger = SelectInputDefaultRenderTrigger;

export { DefaultRenderTrigger, SelectInputDefaultRenderTrigger };
//# sourceMappingURL=SelectInputDefaultRenderTrigger.mjs.map
