text: function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  function _extends() { _extends = Object.assign || 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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  
  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; }
  
  /**
   * Copyright IBM Corp. 2016, 2018
   *
   * This source code is licensed under the Apache-2.0 license found in the
   * LICENSE file in the root directory of this source tree.
   */
  import { settings } from 'carbon-components';
  import cx from 'classnames';
  import React from 'react';
  import PropTypes from 'prop-types';
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes';
  var prefix = settings.prefix;
  /**
   * HeaderGlobalAction is used as a part of the `HeaderGlobalBar`. It is
   * essentially an Icon Button with an additional state to indicate whether it is
   * "active". The active state comes from when a user clicks on the global action
   * which should trigger a panel to appear.
   *
   * Note: children passed to this component should be an Icon.
   */
  
  var HeaderGlobalAction = /*#__PURE__*/React.forwardRef(function HeaderGlobalAction(_ref, ref) {
    var _cx;
  
    var ariaLabel = _ref['aria-label'],
        ariaLabelledBy = _ref['aria-labelledby'],
        children = _ref.children,
        customClassName = _ref.className,
        onClick = _ref.onClick,
        isActive = _ref.isActive,
        rest = _objectWithoutProperties(_ref, ["aria-label", "aria-labelledby", "children", "className", "onClick", "isActive"]);
  
    var className = cx((_cx = {}, _defineProperty(_cx, customClassName, !!customClassName), _defineProperty(_cx, "".concat(prefix, "--header__action"), true), _defineProperty(_cx, "".concat(prefix, "--header__action--active"), isActive), _cx));
    var accessibilityLabel = {
      'aria-label': ariaLabel,
      'aria-labelledby': ariaLabelledBy
    };
    return /*#__PURE__*/React.createElement("button", _extends({}, rest, accessibilityLabel, {
      className: className,
      onClick: onClick,
      type: "button",
      ref: ref
    }), children);
  });
  HeaderGlobalAction.propTypes = _objectSpread(_objectSpread({}, AriaLabelPropType), {}, {
    /**
     * Provide a custom icon for this global action
     */
    children: PropTypes.node.isRequired,
  
    /**
     * Optionally provide a custom class name that is applied to the underlying
     * button
     */
    className: PropTypes.string,
  
    /**
     * Optionally provide an onClick handler that is called when the underlying
     * button fires it's onclick event
     */
    onClick: PropTypes.func,
  
    /**
     * Specify whether the action is currently active
     */
    isActive: PropTypes.bool
  });
  HeaderGlobalAction.displayName = 'HeaderGlobalAction';
  export default HeaderGlobalAction;