var _examples$TABS_EXAMPL;

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

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; }

/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import { styled } from '../styles/index.js';
import { Tabs, StatefulTabs, TabPanel, StyledTabBar, StyledTabContent, StyledTab, ORIENTATION } from './index.js';
import examples from './examples-list.js';
export var suite = 'Component Test Suite';
var Centered = styled('div', {
  position: 'relative',
  display: 'flex',
  flexDirection: 'column',
  justifyContent: 'start',
  alignItems: 'center',
  height: '90vh',
  lineHeight: 1.5,
  width: '500px',
  margin: '0 auto'
});
Centered.displayName = "Centered";
var CustomTabBar = styled(StyledTabBar, function (props) {
  return {
    backgroundColor: 'yellow'
  };
});
CustomTabBar.displayName = "CustomTabBar";
var CustomTabContent = styled(StyledTabContent, function (props) {
  return {
    padding: '10px',
    color: 'red'
  };
});
CustomTabContent.displayName = "CustomTabContent";
var overrides = {
  TabBar: CustomTabBar,
  TabContent: CustomTabContent
};
var CustomTab = styled(StyledTab, function (props) {
  return {
    borderBottom: props.$active ? "2px solid green" : 'none'
  };
});
CustomTab.displayName = "CustomTab";
var tabOverrides = {
  Tab: CustomTab
};

var ControlledTabsStory =
/*#__PURE__*/
function (_React$Component) {
  _inherits(ControlledTabsStory, _React$Component);

  function ControlledTabsStory() {
    var _getPrototypeOf2;

    var _this;

    _classCallCheck(this, ControlledTabsStory);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ControlledTabsStory)).call.apply(_getPrototypeOf2, [this].concat(args)));

    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", {
      activeKey: '0'
    });

    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onChange", function (_ref) {
      var activeKey = _ref.activeKey;

      _this.setState({
        activeKey: activeKey
      });
    });

    return _this;
  }

  _createClass(ControlledTabsStory, [{
    key: "render",
    value: function render() {
      var content = ['Tab Content 1', 'Tab Content 2', 'Tab Content 3'];
      return React.createElement(Centered, null, React.createElement(Tabs, {
        activeKey: this.state.activeKey,
        onChange: this.onChange
      }, React.createElement(TabPanel, {
        title: "Tab Link 1"
      }), React.createElement(TabPanel, {
        title: "Tab Link 2"
      }), React.createElement(TabPanel, {
        title: "Tab Link 3"
      })), React.createElement("div", null, "Content:"), React.createElement("div", null, content[Number(this.state.activeKey)]));
    }
  }]);

  return ControlledTabsStory;
}(React.Component);

export default (_examples$TABS_EXAMPL = {}, _defineProperty(_examples$TABS_EXAMPL, examples.TABS_EXAMPLE, function Story1() {
  return React.createElement(Centered, null, React.createElement(Tabs, {
    activeKey: "1"
  }, React.createElement(TabPanel, {
    title: "Tab Link 1"
  }, "Tab 1 content"), React.createElement(TabPanel, {
    title: "Tab Link 2"
  }, "Tab 2 content"), React.createElement(TabPanel, {
    title: "Tab Link 3"
  }, "Tab 3 content")));
}), _defineProperty(_examples$TABS_EXAMPL, examples.STATEFUL_TABS_EXAMPLE, function Story2() {
  return React.createElement(Centered, null, React.createElement(StatefulTabs, null, React.createElement(TabPanel, {
    title: "Tab Link 1"
  }, "Tab 1 content"), React.createElement(TabPanel, {
    title: "Tab Link 2"
  }, "Tab 2 content"), React.createElement(TabPanel, {
    title: "Tab Link 3"
  }, "Tab 3 content")));
}), _defineProperty(_examples$TABS_EXAMPL, examples.VERTICAL_TABS_EXAMPLE, function Story3() {
  return React.createElement(Centered, null, React.createElement(StatefulTabs, {
    orientation: ORIENTATION.vertical
  }, React.createElement(TabPanel, {
    title: "Tab Link 1"
  }, "Tab 1 content"), React.createElement(TabPanel, {
    title: "Tab Link 2"
  }, "Tab 2 content"), React.createElement(TabPanel, {
    title: "Tab Link 3"
  }, "Tab 3 content")));
}), _defineProperty(_examples$TABS_EXAMPL, examples.STYLE_PROPS_OVERRIDES, function Story4() {
  return React.createElement(Centered, null, React.createElement(StatefulTabs, {
    orientation: ORIENTATION.vertical,
    initialState: {
      activeKey: '1'
    },
    overrides: overrides
  }, React.createElement(TabPanel, {
    title: "Tab 1",
    overrides: tabOverrides
  }, "Tab 1 Content"), React.createElement(TabPanel, {
    title: "Tab 2",
    overrides: tabOverrides
  }, "Tab 2 Content"), React.createElement(TabPanel, {
    title: "Tab 3",
    overrides: tabOverrides
  }, "Tab 3 Content")));
}), _defineProperty(_examples$TABS_EXAMPL, examples.CONTROLLED_TABS_EXAMPLE, function Story5() {
  return React.createElement(ControlledTabsStory, null);
}), _examples$TABS_EXAMPL);