"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.buttonTextLineHeight = exports.buttonTextFontSize = exports.ButtonText = void 0;
var _react = _interopRequireWildcard(require("react"));
var _context = require("../../context");
var _IOText = require("./IOText");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
const buttonTextFontSize = exports.buttonTextFontSize = 16;
const buttonTextLineHeight = exports.buttonTextLineHeight = 20;

/* Needed to render `ButtonOutline` and`ButtonLink` because they use
`AnimatedText` for color transition through Reanimated */
const defaultColor = "white";
const fontName = "Titillio";
const legacyFontName = "TitilliumSansPro";

/**
 * `ButtonText` typographic style
 */
const ButtonText = exports.ButtonText = /*#__PURE__*/(0, _react.forwardRef)(({
  color: customColor,
  ...props
}, ref) => {
  const {
    newTypefaceEnabled
  } = (0, _context.useIONewTypeface)();
  const ButtonTextProps = {
    ...props,
    font: newTypefaceEnabled ? fontName : legacyFontName,
    weight: "Semibold",
    size: buttonTextFontSize,
    lineHeight: buttonTextLineHeight,
    /* Needed to render `ButtonOutline` and`ButtonLink` because they use
    `AnimatedText` for color transition through Reanimated */
    color: customColor ?? defaultColor
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_IOText.IOText, {
    ref: ref,
    ...ButtonTextProps,
    children: props.children
  });
});
//# sourceMappingURL=ButtonText.js.map