"use strict";

import { forwardRef } from "react";
import { Pressable } from "react-native";
import { useIOTheme } from "../../context";
import { IOText } from "./IOText";
import { jsx as _jsx } from "react/jsx-runtime";
export const bodySmallFontSize = 14;
export const bodySmallLineHeight = 21;

/**
 * `BodySmall` typographic style
 */
export const BodySmall = /*#__PURE__*/forwardRef(({
  weight: customWeight,
  color: customColor,
  asLink,
  avoidPressable,
  accessibilityRole = "link",
  textStyle: customTextStyle,
  onPress,
  ...props
}, ref) => {
  const theme = useIOTheme();
  const defaultColor = asLink ? theme["interactiveElem-default"] : theme["textBody-tertiary"];
  const BodySmallProps = {
    ...props,
    dynamicTypeRamp: "footnote" /* iOS only */,
    weight: customWeight ?? "Regular",
    size: bodySmallFontSize,
    lineHeight: bodySmallLineHeight,
    color: customColor ?? defaultColor,
    ...(asLink ? {
      accessibilityRole,
      textStyle: customTextStyle ?? {
        textDecorationLine: "underline"
      }
    } : {})
  };
  if (asLink && !avoidPressable) {
    return /*#__PURE__*/_jsx(Pressable, {
      onPress: onPress,
      ref: ref,
      accessibilityRole: accessibilityRole,
      children: /*#__PURE__*/_jsx(IOText, {
        ...BodySmallProps,
        children: props.children
      })
    });
  }
  return /*#__PURE__*/_jsx(IOText, {
    ref: ref,
    ...BodySmallProps,
    onPress: asLink && avoidPressable ? onPress : undefined,
    children: props.children
  });
});
//# sourceMappingURL=BodySmall.js.map