"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MixinsSpacing = exports.SelectedValue = exports.LocalizedLabels = exports.Default = exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _addonActions = require("@storybook/addon-actions");

var _reactIntl = require("react-intl");

var _index = require("./index");

var _filterBar = _interopRequireDefault(require("./filter-bar.mdx"));

var _marginChecker = require("../../../mixins/spacing/story-support/margin-checker");

var _paddingChecker = require("../../../mixins/spacing/story-support/padding-checker");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var _default = {
  component: _index.FilterBar,
  title: 'Components/Navigation/Filter Bar ⚠️',
  parameters: {
    docs: {
      page: _filterBar["default"]
    }
  }
};
exports["default"] = _default;
var DEFAULT_PROPS = {
  options: [{
    value: 'd5',
    label: '5D'
  }, {
    value: 'm1',
    label: '1M'
  }, {
    value: 'm6',
    label: '6M'
  }, {
    value: 'ytd',
    label: 'YTD'
  }, {
    value: 'y1',
    label: '1Y'
  }, {
    value: 'max',
    label: 'Max'
  }],
  onChange: function onChange(value) {
    (0, _addonActions.action)('Switch toggled')(value);
  }
};

var Default = function Default() {
  return /*#__PURE__*/_react["default"].createElement(_index.FilterBar, DEFAULT_PROPS);
};

exports.Default = Default;

var LocalizedLabels = function LocalizedLabels() {
  return /*#__PURE__*/_react["default"].createElement(_index.FilterBar, _extends({}, DEFAULT_PROPS, {
    options: [{
      value: 'localized',
      label: /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
        id: "test"
      })
    }]
  }));
};

exports.LocalizedLabels = LocalizedLabels;

var SelectedValue = function SelectedValue() {
  return /*#__PURE__*/_react["default"].createElement(_index.FilterBar, _extends({}, DEFAULT_PROPS, {
    selectedValue: "m6"
  }));
};

exports.SelectedValue = SelectedValue;

var MixinsSpacing = function MixinsSpacing() {
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_marginChecker.MarginChecker, _extends({
    Component: _index.FilterBar
  }, DEFAULT_PROPS)), /*#__PURE__*/_react["default"].createElement(_paddingChecker.PaddingChecker, _extends({
    Component: _index.FilterBar
  }, DEFAULT_PROPS)));
};

exports.MixinsSpacing = MixinsSpacing;