"use strict";

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FilterTab = void 0;

var _react = _interopRequireWildcard(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _components = require("./components.css-rules");

var _branding = require("../../../mixins/branding");

var _focus = require("../../../mixins/focus");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var FilterTabButton = _styledComponents["default"].button.withConfig({
  displayName: "FilterTabButton",
  componentId: "sc-1nxibdn-0"
})(["", " z-index:1;background:transparent;color:", ";transition:color 0.15s cubic-bezier(0.34,0,0.53,1.3);border:0;position:relative;", " ", " span{color:", ";border-color:", ";}"], _components.getSelectionIndicatorShape, _components.getForeground, (0, _focus.getBaseFocusState)({
  hoverTransition: false,
  activeTransition: false
}), _focus.FOCUS_VISIBLE_SELECTOR, (0, _branding.getPaletteColor)('greyscale-black'), (0, _branding.getPaletteColor)('greyscale-black'));

var FilterTab = function FilterTab(_ref) {
  var value = _ref.value,
      selected = _ref.selected,
      onClick = _ref.onClick,
      label = _ref.label,
      fontSize = _ref.fontSize,
      forwardRef = _ref.forwardRef;
  var callback = (0, _react.useCallback)(function () {
    onClick(value);
  }, [value, onClick]);
  return _react["default"].createElement(FilterTabButton, {
    ref: forwardRef,
    fontSize: fontSize,
    onClick: callback,
    selected: selected
  }, label);
};

exports.FilterTab = FilterTab;