29 lines
826 B
JavaScript
29 lines
826 B
JavaScript
import { jsx } from "react/jsx-runtime";
|
|
import classNames from "classnames";
|
|
import { forwardRef } from "react";
|
|
function InputError({
|
|
message,
|
|
className,
|
|
children
|
|
}) {
|
|
if (!message && !children) {
|
|
return null;
|
|
}
|
|
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("p", { className: "text-sm text-red-600 dark:text-red-400", children: message || children }) });
|
|
}
|
|
const TextInput = forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
"input",
|
|
{
|
|
...props,
|
|
ref,
|
|
className: classNames(
|
|
"border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-xs",
|
|
props.className
|
|
)
|
|
}
|
|
));
|
|
export {
|
|
InputError as I,
|
|
TextInput as T
|
|
};
|