react-uzprogers-textstyle
Version:
Reusable text style components for React projects, with built-in support for Tailwind and design tokens.
36 lines (35 loc) • 2.02 kB
TypeScript
import { styleMap } from "./textStyleMap";
import React, { JSX } from "react";
declare const variantColors: {
readonly default: "text-black";
readonly danger: "text-red-600";
readonly success: "text-green-600";
readonly warning: "text-yellow-500";
readonly info: "text-blue-500";
};
type Variant = keyof typeof variantColors;
type ElementTag = keyof JSX.IntrinsicElements;
type TextComponentProps = {
token: string;
variant?: Variant;
className?: string;
as?: ElementTag;
children: React.ReactNode;
};
type StyleMap = typeof styleMap;
declare function createTextStyle(customStyleMap?: StyleMap): {
Display: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Heading: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Body: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Button: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Caption: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
};
declare const TextStyle: {
Display: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Heading: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Body: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Button: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
Caption: ({ token, variant, className, as: Tag, children, }: TextComponentProps) => import("react/jsx-runtime").JSX.Element;
};
export { createTextStyle, TextStyle };
export default TextStyle;