"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.TitleExample = exports.Size96 = exports.Size64 = exports.Size48 = exports.Size375 = exports.Size240 = exports.InlineStory = exports.DifferentSecondaryColor = exports.DifferentColor = exports.DefaultUse = exports.AvailableIllustrations = exports.AllIllustrationsColored = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _ = require("../..");
var _Display = require("../../common/Display");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure 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 _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; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var _default = exports.default = {
  title: 'Atoms / Illustration'
};
var DefaultUse = exports.DefaultUse = {
  render: function render() {
    return _react.default.createElement(_.Illustration.Archive48, null);
  },
  name: 'Default use'
};
var InlineStory = exports.InlineStory = {
  render: function render() {
    return _react.default.createElement("span", null, "You can put the ", _react.default.createElement(_.Illustration.Archive48, {
      inline: true
    }), " directly in the text !");
  },
  name: 'Inline'
};
var DifferentColor = exports.DifferentColor = {
  render: function render() {
    return _react.default.createElement("div", {
      style: {
        color: 'blue'
      }
    }, "You can have different color text around", ' ', _react.default.createElement(_.Illustration.Archive48, {
      inline: true,
      color: function color(t) {
        return t.color.positive;
      }
    }), " an Illustration");
  },
  name: 'Different color'
};
var DifferentSecondaryColor = exports.DifferentSecondaryColor = {
  render: function render() {
    return _react.default.createElement("span", null, "Some illustrations have 2 colors", _react.default.createElement(_.Illustration.UrgentMailFill64, {
      color: function color(t) {
        return t.color.icon;
      },
      secondaryColor: function secondaryColor(t) {
        return t.color.shareville;
      }
    }));
  },
  name: 'Different secondary color'
};
var TitleExample = exports.TitleExample = {
  render: function render() {
    return _react.default.createElement("div", {
      style: {
        color: 'blue'
      }
    }, "You can use title prop for a hover tooltip", _react.default.createElement(_.Illustration.Archive48, {
      inline: true,
      title: "example tooltip"
    }), " on an Illustration");
  },
  name: 'Title example'
};
var AvailableIllustrations = exports.AvailableIllustrations = {
  render: function render() {
    var _Object$entries;
    return _react.default.createElement(_Display.Display, {
      items: Object === null || Object === void 0 || (_Object$entries = Object.entries(_.Illustration)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(function (_ref) {
        var _ref2 = _slicedToArray(_ref, 2),
          IllustrationName = _ref2[0],
          IllustrationComponent = _ref2[1];
        return {
          title: IllustrationName,
          component: _react.default.createElement("div", {
            style: {
              outline: '1px dashed #bbb',
              display: 'inline-block'
            }
          }, _react.default.createElement(IllustrationComponent, null))
        };
      })
    });
  }
};
var AllIllustrationsColored = exports.AllIllustrationsColored = {
  render: function render() {
    var _Object$entries2;
    return _react.default.createElement(_react.default.Fragment, null, Object === null || Object === void 0 || (_Object$entries2 = Object.entries(_.Illustration)) === null || _Object$entries2 === void 0 ? void 0 : _Object$entries2.map(function (_ref3) {
      var _ref4 = _slicedToArray(_ref3, 2),
        illustrationName = _ref4[0],
        IllustrationComponent = _ref4[1];
      return _react.default.createElement("div", {
        key: illustrationName,
        style: {
          outline: '1px dashed #bbb',
          display: 'inline-block'
        }
      }, _react.default.createElement(IllustrationComponent, {
        color: function color(t) {
          return t.color.cta;
        }
      }));
    }));
  },
  name: 'All Illustrations (colored)'
};
var StyledFlexbox = (0, _styledComponents.default)(_.Flexbox).withConfig({
  displayName: "Illustrationstories__StyledFlexbox",
  componentId: "sc-13peeq0-0"
})(["background-color:", ";"], function (p) {
  return p.theme.color.badgeIconColor;
});
var StyledLabeledValue = (0, _styledComponents.default)(_.LabeledValue).withConfig({
  displayName: "Illustrationstories__StyledLabeledValue",
  componentId: "sc-13peeq0-1"
})(["align-items:center;margin:12px 0;width:390px;"]);
var SizeIllustrations = function SizeIllustrations(size) {
  var _Object$entries3;
  return _react.default.createElement(StyledFlexbox, {
    container: true,
    gap: 8,
    wrap: "wrap"
  }, Object === null || Object === void 0 || (_Object$entries3 = Object.entries(_.Illustration)) === null || _Object$entries3 === void 0 ? void 0 : _Object$entries3.filter(function (name) {
    return name[0].includes(size);
  }).map(function (_ref5, index) {
    var _ref6 = _slicedToArray(_ref5, 2),
      illustrationName = _ref6[0],
      IllustrationComponent = _ref6[1];
    return _react.default.createElement(StyledLabeledValue, {
      key: illustrationName,
      label: _react.default.createElement(_.Typography, {
        type: "tertiary"
      }, illustrationName)
    }, _react.default.createElement(IllustrationComponent, {
      title: index
    }));
  }));
};
var Size48 = exports.Size48 = {
  render: function render() {
    return _react.default.createElement(_react.default.Fragment, null, SizeIllustrations('48'));
  },
  name: 'Size / 48px'
};
var Size64 = exports.Size64 = {
  render: function render() {
    return _react.default.createElement(_react.default.Fragment, null, SizeIllustrations('64'));
  },
  name: 'Size / 64px'
};
var Size96 = exports.Size96 = {
  render: function render() {
    return _react.default.createElement(_react.default.Fragment, null, SizeIllustrations('96'));
  },
  name: 'Size / 96px'
};
var Size240 = exports.Size240 = {
  render: function render() {
    return _react.default.createElement(_react.default.Fragment, null, SizeIllustrations('240'));
  },
  name: 'Size / 240px'
};
var Size375 = exports.Size375 = {
  render: function render() {
    return _react.default.createElement(_react.default.Fragment, null, SizeIllustrations('375'));
  },
  name: 'Size / 375px'
};