@szum-tech/design-system
Version:
Szum-Tech design system with tailwindcss support
31 lines (28 loc) • 712 B
JavaScript
import { twMerge } from 'tailwind-merge';
import { cva } from 'class-variance-authority';
import { jsx } from 'react/jsx-runtime';
// src/components/helper-text/helper-text.tsx
var helperTextCva = cva("", {
variants: {
type: {
description: "text-body-2 text-gray-300",
error: "text-caption text-error-500"
}
},
defaultVariants: {
type: "description"
}
});
function HelperText({ className, children, type = "description", role, ref, ...props }) {
return /* @__PURE__ */ jsx(
"p",
{
ref,
className: twMerge(helperTextCva({ type }), className),
role: type === "error" ? "alert" : role,
...props,
children
}
);
}
export { HelperText };