"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.WithBorder = exports.RendersNothingIfWrongCountryCode = exports.InlineStory = exports.DefaultUse = exports.AvailableFlags = void 0;
var _react = _interopRequireDefault(require("react"));
var _flags = _interopRequireDefault(require("./components/flags"));
var _index = require("../../index");
var _Display = require("../../common/Display");
var _Flag = require("./Flag");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var _default = exports.default = {
  title: 'Atoms / Flag',
  parameters: {
    component: _Flag.Flag
  }
};
var DefaultUse = exports.DefaultUse = {
  render: function render() {
    return _react.default.createElement(_Flag.Flag, {
      size: "m",
      country: "SE"
    });
  },
  name: 'Default use'
};
var InlineStory = exports.InlineStory = {
  render: function render() {
    return _react.default.createElement(_react.default.Fragment, null, "You can put the ", _react.default.createElement(_Flag.Flag, {
      size: "m",
      inline: true,
      country: "SE"
    }), " directly in the text with inline prop!");
  },
  name: 'Inline'
};
var RendersNothingIfWrongCountryCode = exports.RendersNothingIfWrongCountryCode = {
  render: function render() {
    return _react.default.createElement(_Flag.Flag, {
      size: "l",
      country: "WRONG"
    });
  },
  name: 'Renders nothing if wrong country code'
};
var AvailableFlags = exports.AvailableFlags = {
  render: function render() {
    return _react.default.createElement(_Display.Display, {
      items: [{
        title: 'Sizes',
        component: _react.default.createElement("div", {
          style: {
            display: 'flex',
            justifyContent: 'space-evenly',
            alignItems: 'center'
          }
        }, _react.default.createElement("div", null, "s (12px)"), _react.default.createElement("div", null, "m (16px)"), _react.default.createElement("div", null, "l (24px)"))
      }].concat(_toConsumableArray(Object.keys(_flags.default).map(function (flagName) {
        return {
          title: flagName,
          component: _react.default.createElement("div", {
            style: {
              display: 'flex',
              justifyContent: 'space-evenly',
              alignItems: 'center'
            }
          }, _react.default.createElement(_Flag.Flag, {
            size: "s",
            country: flagName
          }), _react.default.createElement(_Flag.Flag, {
            size: "m",
            country: flagName
          }), _react.default.createElement(_Flag.Flag, {
            size: "l",
            country: flagName
          }))
        };
      })))
    });
  },
  name: 'Available flags'
};
var WithBorder = exports.WithBorder = {
  render: function render() {
    return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_index.Box, {
      p: 4
    }, _react.default.createElement(_Flag.Flag, {
      size: "m",
      country: "fi"
    }), _react.default.createElement(_index.Typography, {
      type: "secondary"
    }, "Notice flag does not have border on dark mode")));
  },
  name: 'Only Border On Light Mode'
};