"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.NumberFractionDigits = exports.Regular = exports.default = void 0;

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

var _README = _interopRequireDefault(require("./README.mdx"));

var _ = _interopRequireDefault(require("."));

var _Table = _interopRequireDefault(require("../Table"));

var _Text = _interopRequireDefault(require("../Text"));

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

var _default = {
  title: 'Components/Content Related/Unit',
  component: _.default,
  parameters: {
    componentSubtitle: 'Component',
    status: 'released',
    mdx: _README.default
  }
};
exports.default = _default;

var Regular = function Regular(args) {
  return /*#__PURE__*/_react.default.createElement(_.default, args);
};

exports.Regular = Regular;
Regular.args = {
  children: '12345',
  type: 'usd'
};
var description = "\nYou can customize the content by using `BannerNavigation`.\n";
Regular.story = {
  parameters: {
    docs: {
      storyDescription: description
    }
  }
};

var NumberFractionDigits = function NumberFractionDigits() {
  return /*#__PURE__*/_react.default.createElement(_Table.default, null, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, "Input value"), /*#__PURE__*/_react.default.createElement("td", null, "minimumFractionDigits"), /*#__PURE__*/_react.default.createElement("td", null, "maximumFractionDigits"), /*#__PURE__*/_react.default.createElement("td", null, "Result"), /*#__PURE__*/_react.default.createElement("td", null, "Comment"))), /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, "0.1234567"), /*#__PURE__*/_react.default.createElement("td", null, "3"), /*#__PURE__*/_react.default.createElement("td", null, "3"), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_.default, {
    type: "Num",
    minimumFractionDigits: 3,
    maximumFractionDigits: 3
  }, 0.1234567)), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_Text.default, {
    kind: "caption"
  }, "uses minimumFractionDigits and maximumFractionDigits"))), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, "0.1234567"), /*#__PURE__*/_react.default.createElement("td", null, "0"), /*#__PURE__*/_react.default.createElement("td", null, "0"), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_.default, {
    type: "Num",
    minimumFractionDigits: 0,
    maximumFractionDigits: 0
  }, 0.1234567)), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_Text.default, {
    kind: "caption"
  }, "detects value smaller than 1 and adopts minimumFractionDigits to avoid displaying 0"))), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, "12345.1234567"), /*#__PURE__*/_react.default.createElement("td", null, "0"), /*#__PURE__*/_react.default.createElement("td", null, "0"), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_.default, {
    type: "Num",
    minimumFractionDigits: 0,
    maximumFractionDigits: 0
  }, 12345.1234567)), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_Text.default, {
    kind: "caption"
  }, "detects value larger than 1 uses minimumFractionDigits and maximumFractionDigits")))));
};

exports.NumberFractionDigits = NumberFractionDigits;
NumberFractionDigits.story = {
  parameters: {
    docs: {
      storyDescription: "You can customize the number of decimal places by changing the `minimumFractionDigits` and `maximumFractionDigits` prop. If `value < 1` is getting displayed the `minimumFractionDigits` will automatically adopt to display the significant decimal places."
    }
  }
};