"use strict";

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

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

var _index = require("./index");

var _styletronReact = require("styletron-react");

var _examplesList = _interopRequireDefault(require("./examples-list"));

var _tests$ALL_BASIC_COLO;

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

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

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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var colorIcons = {
  '#05dc12': "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAC8ElEQVRYhb2TS08aYRhGPzdd9A+4bFfua4ziBauhGgxRUcBxwCJFjHhlLKK1ar2ARI0ViLFGjcUoIqhIWwsxJsa0SfsD2j/CvtWni6rfFKZMZhSf5KyYk/fABEKuZhqOc+xwLMW6Ysgpw7GUaTjOEf7YoRjHOA9gGjmC3X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0/1f4e/JCZH3148/4PdvvhZ5TxKX8SRxmfOEmqY1uFKn4AGGFfI3t9W1eEhrJAWAWwFge21V5LF71itcHeH2hasje+67ra7FsEL+hgNIKKnRYZUSU1oVZvTqimpKq8KwSomEkhpl848QQqouKKpXLipqMKaSI61R4jdd3YEqrVFiTCXHRUUNLiiqVwghVTvZpIoQYiCEWM7VHLvDUMc3vv20GpUQQx3fOFdz7A4hxLKTWSUCIIS0H5JEAEd2mqOEkE8OSUfZT/AvpLZs7lVi3lIAAAAASUVORK5CYII="
};
var tagStyleKinds = Object.keys(_index.KIND);

var _default = (_tests$ALL_BASIC_COLO = {}, _defineProperty(_tests$ALL_BASIC_COLO, _examplesList.default.ALL_BASIC_COLORS, function () {
  return React.createElement(React.Fragment, null, React.createElement("div", {
    style: {
      width: '200px'
    }
  }, React.createElement(_index.Tag, {
    key: "default",
    onActionClick: function onActionClick(e, tag) {
      if (typeof tag === 'string') {
        // eslint-disable-next-line no-console
        console.log('Tag is clicked:' + tag);
      }
    }
  }, "Default Color"), tagStyleKinds.map(function (kind) {
    return React.createElement(_index.Tag, {
      key: kind,
      kind: kind,
      color: kind === 'custom' ? '#748ecc' : undefined,
      onActionClick: function onActionClick(e, tag) {
        if (typeof tag === 'string') {
          // eslint-disable-next-line no-console
          console.log('Tag is clicked:' + tag);
        }
      }
    }, "kind ", kind);
  })));
}), _defineProperty(_tests$ALL_BASIC_COLO, _examplesList.default.WITH_CUSTOM_COLORS, function () {
  return React.createElement(React.Fragment, null, React.createElement("div", {
    style: {
      width: '200px'
    }
  }, ['#000000', '#00ff35'].map(function (color) {
    return React.createElement(_index.Tag, {
      key: color,
      color: color,
      kind: "custom",
      onActionClick: function onActionClick(e, tag) {
        if (typeof tag === 'string') {
          // eslint-disable-next-line no-console
          console.log('Tag is clicked:' + tag);
        }
      },
      overrides: {
        Root: (0, _styletronReact.withStyle)(_index.StyledRoot, function (props) {
          return {
            color: props.$color
          };
        })
      }
    }, "Color ", color);
  })));
}), _defineProperty(_tests$ALL_BASIC_COLO, _examplesList.default.WITH_CUSTOM_COMPONENTS, function () {
  return React.createElement(React.Fragment, null, React.createElement("div", {
    style: {
      width: '200px'
    }
  }, //$FlowFixMe
  Object.entries(colorIcons).map(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 2),
        color = _ref2[0],
        icon = _ref2[1];

    return React.createElement(_index.Tag, {
      key: color,
      color: color,
      kind: "custom",
      onActionClick: function onActionClick(e, tag) {
        if (typeof tag === 'string') {
          // eslint-disable-next-line no-console
          console.log('Tag is clicked:' + tag);
        }
      },
      overrides: {
        Root: (0, _styletronReact.withStyle)(_index.StyledRoot, function (props) {
          return {
            color: props.$color,
            backgroundColor: props.$color + '0f'
          };
        })
      }
    }, "Color ", color, " ", React.createElement("img", {
      src: icon,
      alt: "".concat(color, " color swatch")
    }));
  })));
}), _defineProperty(_tests$ALL_BASIC_COLO, _examplesList.default.DISABLED, function () {
  return React.createElement(React.Fragment, null, React.createElement("div", {
    style: {
      width: '200px'
    }
  }, tagStyleKinds.map(function (kind) {
    return React.createElement(_index.Tag, {
      disabled: true,
      key: kind,
      kind: kind,
      onActionClick: function onActionClick(e) {
        var tag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

        if (typeof tag === 'string') {
          // eslint-disable-next-line no-console
          console.log('Tag is clicked:' + tag);
        }
      }
    }, "kind ", kind);
  })));
}), _tests$ALL_BASIC_COLO);

exports.default = _default;