UNPKG

@veracity/vui

Version:

Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.

38 lines (36 loc) 1.14 kB
import { filterUndefined } from "../utils/object.js"; import { cs } from "../utils/styles.js"; import { omitThemingProps, useStyleConfig } from "../core/theme.js"; import styled from "../core/styled.js"; import vui from "../core/vui.js"; import { jsx } from "react/jsx-runtime"; //#region src/t/t.tsx const TBase = styled.spanBox` transition-duration: fast; `; /** Displays given text and allows easy styling. */ const T = vui((props, ref) => { const { align, casing, centerV, children, className, decoration, text, weight, ...rest } = omitThemingProps(props); const styles = useStyleConfig("T", props); const aliasedProps = filterUndefined({ alignItems: centerV ? "center" : void 0, display: centerV ? "inline-flex" : void 0, fontWeight: weight, textAlign: align, textDecoration: decoration, textTransform: casing }); return /* @__PURE__ */ jsx(TBase, { className: cs("vui-t", className), ref, ...styles, ...aliasedProps, ...rest, children: children ?? text }); }); T.displayName = "T"; //#endregion export { T, T as default, TBase }; globalThis.__vuiVersion__ = "5.3.1" //# sourceMappingURL=t.js.map