"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.WithVariantBig = exports.WithInitialActiveTabIndex = exports.IntegrationWithTypographyAndExtraSpaceInside = exports.IntegrationWithFadedScrollWithHeightFromParent = exports.IntegrationWithFadedScroll = exports.ControlledBehaviour = void 0;
var _react = _interopRequireWildcard(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _addonActions = require("@storybook/addon-actions");
var _ = require("../..");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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 mockedText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam dictum nulla tincidunt\ninterdum ornare. Duis blandit nibh nec dui varius lobortis. Sed viverra, metus quis\nvulputate accumsan, eros lacus semper nisl, in commodo risus lacus ut libero. Aliquam augue\nquam, sollicitudin quis lectus quis, viverra gravida nibh. Quisque vel mi non tortor\nsollicitudin sodales id eget odio. Sed mollis eleifend leo, et sagittis mi. Curabitur\ncursus, elit ut porta vehicula, elit ipsum sagittis erat, in dapibus sapien ipsum ut purus.\nAliquam sit amet egestas lacus. Aenean leo augue, malesuada id nibh ac, malesuada fermentum\ntortor. Vivamus dolor ante, fringilla vel consequat in, hendrerit vel metus. Quisque eget\nornare turpis. Suspendisse a lectus tortor. Sed ultrices lorem nibh, ultrices pulvinar eros\ndictum sit amet. Quisque et ipsum in tellus pharetra tempus. Morbi non nunc rhoncus nisi\npellentesque sagittis. Ut eu sem et ante facilisis consequat. Aliquam lorem ligula, laoreet\nquis maximus vel, rhoncus ut odio. Mauris interdum aliquet dolor ac efficitur. Maecenas\negestas porttitor tempor. In at dui tellus. Praesent at lorem metus. Quisque ultricies,\nnulla sed pulvinar volutpat, libero enim auctor erat, nec consectetur purus lacus sed orci.\nIn eleifend a risus at pulvinar. Donec ultricies justo et ligula venenatis, sed ultrices\nnunc dignissim.";
var HeightOnCardWithTabs = (0, _styledComponents.default)(_.CardWithTabs).withConfig({
  displayName: "CardWithTabsstories__HeightOnCardWithTabs",
  componentId: "sc-11n6k03-0"
})(["", "{height:200px;}"], function (p) {
  return p.theme.media.greaterThan(p.theme.breakpoints.md);
});
var _default = exports.default = {
  title: 'Organisms / CardWithTabs'
};
var WithInitialActiveTabIndex = exports.WithInitialActiveTabIndex = {
  render: function render() {
    return _react.default.createElement(_.CardWithTabs, {
      title: _react.default.createElement(_.Typography, {
        type: "title3",
        as: "h2"
      }, "Title for the card"),
      initialActiveTabIndex: 1
    }, _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 1",
      onTitleClick: (0, _addonActions.action)('Clicked title1')
    }, "1"), _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 2"
    }, "2"));
  },
  name: 'with initialActiveTabIndex'
};
var WithVariantBig = exports.WithVariantBig = {
  render: function render() {
    return _react.default.createElement(_.CardWithTabs, {
      variant: "big",
      title: "Title for the card",
      initialActiveTabIndex: 0
    }, _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 1",
      onTitleClick: (0, _addonActions.action)('Clicked title1')
    }, "1"), _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 2",
      onTitleClick: (0, _addonActions.action)('Clicked title2')
    }, "2"));
  }
};
var ControlledBehaviour = exports.ControlledBehaviour = {
  render: function render() {
    var ControlledComponent = function ControlledComponent() {
      var _useState = (0, _react.useState)(0),
        _useState2 = _slicedToArray(_useState, 2),
        active = _useState2[0],
        setActive = _useState2[1];
      return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("button", {
        type: "button",
        onClick: function onClick() {
          return setActive(active === 0 ? 1 : 0);
        }
      }, "Change state outside"), _react.default.createElement(_.CardWithTabs, {
        title: _react.default.createElement(_.Typography, {
          type: "title3",
          as: "h2"
        }, "Title for the card"),
        activeTabIndex: active
      }, _react.default.createElement(_.CardWithTabs.Tab, {
        title: "Tab title 1",
        onTitleClick: function onTitleClick() {
          return setActive(0);
        }
      }, "Tab content 1"), _react.default.createElement(_.CardWithTabs.Tab, {
        title: "Tab title 2",
        onTitleClick: function onTitleClick() {
          return setActive(1);
        }
      }, "Tab content 2")));
    };
    return _react.default.createElement(ControlledComponent, null);
  }
};
var IntegrationWithTypographyAndExtraSpaceInside = exports.IntegrationWithTypographyAndExtraSpaceInside = {
  render: function render() {
    return _react.default.createElement(_.CardWithTabs, {
      title: _react.default.createElement(_.Typography, {
        type: "title3",
        as: "h2"
      }, "Title for the card")
    }, _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 1"
    }, _react.default.createElement(_.Box, {
      pt: 4,
      px: 5,
      pb: 5
    }, mockedText)), _react.default.createElement(_.CardWithTabs.Tab, {
      title: _react.default.createElement("span", {
        style: {
          color: 'red'
        }
      }, "Custom title component")
    }, _react.default.createElement(_.Box, {
      pt: 4,
      px: 5,
      pb: 5
    }, "Some stuff for Tab 2")));
  },
  name: 'Integration: with Typography and extra space inside'
};
var IntegrationWithFadedScroll = exports.IntegrationWithFadedScroll = {
  render: function render() {
    return _react.default.createElement(_.CardWithTabs, {
      title: _react.default.createElement(_.Typography, {
        type: "title3",
        as: "h2"
      }, "Title for the card")
    }, _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 1"
    }, _react.default.createElement(_.FadedScroll, {
      maxHeight: 20
    }, _react.default.createElement(_.Box, {
      pt: 4,
      px: 5
    }, mockedText))), _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 2"
    }, _react.default.createElement(_.Box, {
      pt: 4,
      px: 5,
      pb: 5
    }, "Some stuff for Tab 2")));
  },
  name: 'Integration: with FadedScroll'
};
var IntegrationWithFadedScrollWithHeightFromParent = exports.IntegrationWithFadedScrollWithHeightFromParent = {
  render: function render() {
    return _react.default.createElement(HeightOnCardWithTabs, {
      title: _react.default.createElement(_.Typography, {
        type: "title3",
        as: "h2"
      }, "Title for the card")
    }, _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 1"
    }, _react.default.createElement(_.FadedScroll, null, _react.default.createElement(_.Box, {
      pt: 4,
      px: 5
    }, mockedText))), _react.default.createElement(_.CardWithTabs.Tab, {
      title: "Tab title 2"
    }, _react.default.createElement(_.Box, {
      pt: 4,
      px: 5,
      pb: 5
    }, "Some stuff for Tab 2")));
  },
  name: 'Integration: with FadedScroll of content and height being whatever is available left of parents height.'
};