'use strict';

require('react');
var clsx = require('clsx');
var icons = require('@transferwise/icons');
var IconButton = require('../../../iconButton/IconButton.js');
var reactIntl = require('react-intl');
var Expander_messages = require('./Expander.messages.js');
var jsxRuntime = require('react/jsx-runtime');

// Reusable toggle button component
const ExpanderToggle = ({
  expanded,
  onToggle,
  size = 24,
  className,
  'data-testid': testId
}) => {
  const intl = reactIntl.useIntl();
  return /*#__PURE__*/jsxRuntime.jsx(IconButton.default, {
    size: size,
    priority: "secondary",
    "aria-label": intl.formatMessage(expanded ? Expander_messages.default.collapseAriaLabel : Expander_messages.default.expandAriaLabel),
    "aria-expanded": expanded,
    className: clsx.clsx('wds-expander-toggle', {
      'wds-expander-toggle--collapsed': !expanded
    }, className),
    "data-testid": testId,
    onClick: onToggle,
    children: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronUp, {})
  });
};

exports.ExpanderToggle = ExpanderToggle;
//# sourceMappingURL=Expander.js.map
