UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

64 lines (63 loc) 1.5 kB
import Text_module_css_default from "./Text.module.css.js"; import { fixedForwardRef } from "../utils/modern-polymorphic.js"; import { c } from "react-compiler-runtime"; import { clsx } from "clsx"; import { jsx } from "react/jsx-runtime"; //#region src/Text/Text.tsx function Text(props, ref) { const $ = c(17); let className; let rest; let size; let t0; let weight; let whiteSpace; if ($[0] !== props) { ({as: t0, className, size, weight, whiteSpace, ...rest} = props); $[0] = props; $[1] = className; $[2] = rest; $[3] = size; $[4] = t0; $[5] = weight; $[6] = whiteSpace; } else { className = $[1]; rest = $[2]; size = $[3]; t0 = $[4]; weight = $[5]; whiteSpace = $[6]; } const Component = t0 === void 0 ? "span" : t0; let t1; if ($[7] !== className) { t1 = clsx(className, Text_module_css_default.Text); $[7] = className; $[8] = t1; } else t1 = $[8]; let t2; if ($[9] !== Component || $[10] !== ref || $[11] !== rest || $[12] !== size || $[13] !== t1 || $[14] !== weight || $[15] !== whiteSpace) { t2 = /*#__PURE__*/ jsx(Component, { className: t1, "data-size": size, "data-weight": weight, "data-white-space": whiteSpace, ...rest, ref }); $[9] = Component; $[10] = ref; $[11] = rest; $[12] = size; $[13] = t1; $[14] = weight; $[15] = whiteSpace; $[16] = t2; } else t2 = $[16]; return t2; } Text.displayName = "Text"; var Text_default = fixedForwardRef(Text); //#endregion export { Text_default as default };