"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.WithIcon = exports.WithDifferentColors = exports.RegressionValueIsNonZeroButRoundedValueIs0 = exports.RegressionInfinity = exports.IntegrationWithDifferentTypographies = exports.Documentation = exports.Default = exports.AsPercentage = exports.AsCurrency = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactMarkdown = _interopRequireDefault(require("react-markdown"));
var _reactIntl = require("react-intl");
var _Development = _interopRequireDefault(require("./Development.md"));
var _index = require("../../index");
var _Display = require("../../common/Display");
var _Typography = require("../../Atoms/Typography/Typography");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = exports.default = {
  title: 'Organisms / Development'
};
var Documentation = exports.Documentation = function Documentation() {
  return _react.default.createElement(_reactIntl.IntlProvider, {
    locale: "en"
  }, _react.default.createElement(_index.Typography, null, _react.default.createElement(_reactMarkdown.default, null, _Development.default), _react.default.createElement("div", null, _react.default.createElement(_index.Development, {
    value: 50,
    currency: "SEK"
  })), _react.default.createElement("div", null, _react.default.createElement(_index.Development, {
    value: 0,
    percentage: true
  })), _react.default.createElement("div", null, _react.default.createElement(_index.Development, {
    value: -2.3,
    percentage: true
  }))));
};
var Default = exports.Default = {
  render: function render() {
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: [{
        title: 'Positive value',
        component: _react.default.createElement(_index.Development, {
          value: 50
        })
      }, {
        title: 'Zero value',
        component: _react.default.createElement(_index.Development, {
          value: 0
        })
      }, {
        title: 'Negative value',
        component: _react.default.createElement(_index.Development, {
          value: -200
        })
      }]
    }));
  }
};
var WithIcon = exports.WithIcon = {
  render: function render() {
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: [{
        title: 'Positive value',
        component: _react.default.createElement(_index.Development, {
          value: 50,
          icon: true
        })
      }, {
        title: 'Zero value',
        component: _react.default.createElement(_index.Development, {
          value: 0,
          icon: true
        })
      }, {
        title: 'Negative value',
        component: _react.default.createElement(_index.Development, {
          value: -200,
          icon: true
        })
      }]
    }));
  }
};
var AsPercentage = exports.AsPercentage = {
  render: function render() {
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: [{
        title: 'Positive value',
        component: _react.default.createElement(_index.Development, {
          value: 5.4,
          percentage: true
        })
      }, {
        title: 'Zero value',
        component: _react.default.createElement(_index.Development, {
          value: 0,
          percentage: true
        })
      }, {
        title: 'Negative value',
        component: _react.default.createElement(_index.Development, {
          value: -2.1,
          percentage: true
        })
      }]
    }));
  }
};
var AsCurrency = exports.AsCurrency = {
  render: function render() {
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: [{
        title: 'Positive value',
        component: _react.default.createElement(_index.Development, {
          value: 50,
          currency: "USD"
        })
      }, {
        title: 'Zero value',
        component: _react.default.createElement(_index.Development, {
          value: 0,
          currency: "USD"
        })
      }, {
        title: 'Negative value',
        component: _react.default.createElement(_index.Development, {
          value: -200,
          currency: "USD"
        })
      }]
    }));
  }
};
var WithDifferentColors = exports.WithDifferentColors = {
  render: function render() {
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: [{
        title: 'Positive value',
        component: _react.default.createElement(_index.Development, {
          value: 50,
          positiveColor: function positiveColor(c) {
            return c.color.positive;
          }
        })
      }, {
        title: 'Zero value',
        component: _react.default.createElement(_index.Development, {
          value: 0
        })
      }, {
        title: 'Negative value',
        component: _react.default.createElement(_index.Development, {
          value: -200,
          negativeColor: function negativeColor(c) {
            return c.color.negative;
          }
        })
      }]
    }));
  }
};
var RegressionInfinity = exports.RegressionInfinity = {
  render: function render() {
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: [{
        title: '+Infinity',
        component: _react.default.createElement(_index.Development, {
          value: Infinity
        })
      }, {
        title: '-Infinity',
        component: _react.default.createElement(_index.Development, {
          value: -Infinity
        })
      }]
    }));
  },
  name: 'Regression: infinity'
};
var RegressionValueIsNonZeroButRoundedValueIs0 = exports.RegressionValueIsNonZeroButRoundedValueIs0 = {
  render: function render() {
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: [{
        title: '`value = 0.3` and decimals = 0',
        component: _react.default.createElement(_index.Development, {
          value: 0.3,
          decimals: 0
        })
      }, {
        title: '`value = -0.3 and decimals = 0`',
        component: _react.default.createElement(_index.Development, {
          value: -0.3,
          decimals: 0
        })
      }, {
        title: '`value = -1.3123 and decimals = 3`',
        component: _react.default.createElement(_index.Development, {
          value: -1.3123,
          decimals: 3
        })
      }, {
        title: '`value = -0.3 and maximumDecimals = 0`',
        component: _react.default.createElement(_index.Development, {
          value: -0.3,
          maximumDecimals: 0
        })
      }, {
        title: '`value = 0.3`',
        component: _react.default.createElement(_index.Development, {
          value: +0.3,
          ticks: [{
            fromPrice: 0,
            toPrice: 1000,
            decimals: 0,
            tick: 1
          }]
        })
      }]
    }));
  },
  name: 'Regression: value is non-zero, but rounded value is 0'
};
var IntegrationWithDifferentTypographies = exports.IntegrationWithDifferentTypographies = {
  render: function render() {
    var _Object$values;
    var items = (_Object$values = Object.values(_Typography.TYPOGRAPHY_TYPES)) === null || _Object$values === void 0 ? void 0 : _Object$values.map(function (type) {
      return {
        title: type,
        component: _react.default.createElement(_index.Typography, {
          type: type
        }, _react.default.createElement(_Display.Display, {
          items: [{
            title: 'Positive value',
            component: _react.default.createElement(_index.Development, {
              value: 5.4
            })
          }, {
            title: 'Zero value',
            component: _react.default.createElement(_index.Development, {
              value: 0
            })
          }, {
            title: 'Negative value',
            component: _react.default.createElement(_index.Development, {
              value: -2.1
            })
          }]
        }))
      };
    });
    return _react.default.createElement(_reactIntl.IntlProvider, {
      locale: "en"
    }, _react.default.createElement(_Display.Display, {
      items: items
    }));
  },
  name: 'Integration: with different typographies'
};