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; }
import React from 'react';
import styled from 'styled-components';
import { Illustration, Flexbox, LabeledValue, Typography } from '../..';
import { Display } from '../../common/Display';
export default {
  title: 'Atoms / Illustration'
};
export var DefaultUse = {
  render: function render() {
    return React.createElement(Illustration.Archive48, null);
  },
  name: 'Default use'
};
export var InlineStory = {
  render: function render() {
    return React.createElement("span", null, "You can put the ", React.createElement(Illustration.Archive48, {
      inline: true
    }), " directly in the text !");
  },
  name: 'Inline'
};
export var DifferentColor = {
  render: function render() {
    return React.createElement("div", {
      style: {
        color: 'blue'
      }
    }, "You can have different color text around", ' ', React.createElement(Illustration.Archive48, {
      inline: true,
      color: function color(t) {
        return t.color.positive;
      }
    }), " an Illustration");
  },
  name: 'Different color'
};
export var DifferentSecondaryColor = {
  render: function render() {
    return React.createElement("span", null, "Some illustrations have 2 colors", React.createElement(Illustration.UrgentMailFill64, {
      color: function color(t) {
        return t.color.icon;
      },
      secondaryColor: function secondaryColor(t) {
        return t.color.shareville;
      }
    }));
  },
  name: 'Different secondary color'
};
export var TitleExample = {
  render: function render() {
    return React.createElement("div", {
      style: {
        color: 'blue'
      }
    }, "You can use title prop for a hover tooltip", React.createElement(Illustration.Archive48, {
      inline: true,
      title: "example tooltip"
    }), " on an Illustration");
  },
  name: 'Title example'
};
export var AvailableIllustrations = {
  render: function render() {
    var _Object$entries;
    return React.createElement(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.createElement("div", {
            style: {
              outline: '1px dashed #bbb',
              display: 'inline-block'
            }
          }, React.createElement(IllustrationComponent, null))
        };
      })
    });
  }
};
export var AllIllustrationsColored = {
  render: function render() {
    var _Object$entries2;
    return React.createElement(React.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.createElement("div", {
        key: illustrationName,
        style: {
          outline: '1px dashed #bbb',
          display: 'inline-block'
        }
      }, React.createElement(IllustrationComponent, {
        color: function color(t) {
          return t.color.cta;
        }
      }));
    }));
  },
  name: 'All Illustrations (colored)'
};
var StyledFlexbox = styled(Flexbox).withConfig({
  displayName: "Illustrationstories__StyledFlexbox",
  componentId: "sc-13peeq0-0"
})(["background-color:", ";"], function (p) {
  return p.theme.color.badgeIconColor;
});
var StyledLabeledValue = styled(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.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.createElement(StyledLabeledValue, {
      key: illustrationName,
      label: React.createElement(Typography, {
        type: "tertiary"
      }, illustrationName)
    }, React.createElement(IllustrationComponent, {
      title: index
    }));
  }));
};
export var Size48 = {
  render: function render() {
    return React.createElement(React.Fragment, null, SizeIllustrations('48'));
  },
  name: 'Size / 48px'
};
export var Size64 = {
  render: function render() {
    return React.createElement(React.Fragment, null, SizeIllustrations('64'));
  },
  name: 'Size / 64px'
};
export var Size96 = {
  render: function render() {
    return React.createElement(React.Fragment, null, SizeIllustrations('96'));
  },
  name: 'Size / 96px'
};
export var Size240 = {
  render: function render() {
    return React.createElement(React.Fragment, null, SizeIllustrations('240'));
  },
  name: 'Size / 240px'
};
export var Size375 = {
  render: function render() {
    return React.createElement(React.Fragment, null, SizeIllustrations('375'));
  },
  name: 'Size / 375px'
};