var _excluded = ["children", "selected", "icon", "size"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { StyledToggleButton } from './ToggleButton.styles';
/**

 A toggle button can be used when an element needs to remain active or open
 for extended periods of time. The affects of a toggle button should visibly
 change content on the page.

 @since 10.19.0

 @see [Storybook](https://procore.github.io/core/core-react/latest/?path=/story/demos-togglebutton--demo)

 @see [Design Guidelines](https://design.procore.com/toggle-button)

 @a11y  @a11y Important: it is critical the label on a toggle does not change when its `selected` prop changes. Alternatively, if the design were to call for the button label to change from "Mute" to "Unmute," the `aria-pressed` prop should be set to `undefined`.

 @see https://www.w3.org/WAI/ARIA/apg/patterns/button/

 */
export var ToggleButton = /*#__PURE__*/React.forwardRef(function ToggleButton(_ref, ref) {
  var children = _ref.children,
    _ref$selected = _ref.selected,
    selected = _ref$selected === void 0 ? false : _ref$selected,
    icon = _ref.icon,
    size = _ref.size,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement(StyledToggleButton, _extends({
    "aria-pressed": selected
  }, props, {
    $selected: selected,
    icon: icon,
    size: size,
    variant: "tertiary",
    ref: ref
  }), children || null);
});
ToggleButton.displayName = 'ToggleButton';
//# sourceMappingURL=ToggleButton.js.map