/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { cn } from "../../utils/cn.js";
import { buildSpacingClasses } from "../../tokens/spacing.js";
import "react";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/core/Text/Text.tsx
var sizeClasses = {
	xs: "text-xs",
	sm: "text-sm",
	base: "text-base",
	lg: "text-lg",
	xl: "text-xl",
	"2xl": "text-2xl",
	"3xl": "text-3xl"
};
var weightClasses = {
	light: "font-light",
	normal: "font-normal",
	medium: "font-medium",
	semibold: "font-semibold",
	bold: "font-bold"
};
var variantClasses = {
	default: "",
	muted: "text-text-muted",
	subtle: "text-text-subtle"
};
var colorClasses = {
	primary: "text-primary",
	secondary: "text-secondary",
	accent: "text-accent",
	error: "text-error-text",
	success: "text-success-text",
	warning: "text-warning-text",
	info: "text-info-text"
};
var Text = ({ children, text, as: Component = "p", size, weight, variant = "default", color, className = "", icon, padding, paddingX, paddingY, paddingTop, paddingBottom, margin, marginX, marginY, marginTop, marginBottom, gap, testId, ...restHtmlProps }) => {
	const renderable = text ?? children;
	if (renderable == null) return null;
	return /* @__PURE__ */ jsxs(Component, {
		className: cn(color ? colorClasses[color] : variantClasses[variant], size && sizeClasses[size], weight && weightClasses[weight], buildSpacingClasses({
			padding,
			paddingX,
			paddingY,
			paddingTop,
			paddingBottom,
			margin,
			marginX,
			marginY,
			marginTop,
			marginBottom,
			gap
		}), className) || void 0,
		"data-testid": testId,
		...restHtmlProps,
		children: [icon && /* @__PURE__ */ jsx("span", {
			className: "mr-2 inline-flex items-center",
			children: icon
		}), renderable]
	});
};
//#endregion
export { Text };

//# sourceMappingURL=Text.js.map