@szum-tech/design-system
Version:
Szum-Tech design system with tailwindcss support
33 lines (29 loc) • 814 B
JavaScript
;
var tailwindMerge = require('tailwind-merge');
var classVarianceAuthority = require('class-variance-authority');
var jsxRuntime = require('react/jsx-runtime');
// src/components/helper-text/helper-text.tsx
var helperTextCva = classVarianceAuthority.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__ */ jsxRuntime.jsx(
"p",
{
ref,
className: tailwindMerge.twMerge(helperTextCva({ type }), className),
role: type === "error" ? "alert" : role,
...props,
children
}
);
}
exports.HelperText = HelperText;