@restnfeel/agentc-starter-kit
Version:
한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템
14 lines (11 loc) • 1.2 kB
JavaScript
"use client";
import { jsxs, jsx } from 'react/jsx-runtime';
import React, { forwardRef } from 'react';
import { cn } from '../../utils/cn.js';
const Input = forwardRef(({ className, label, helperText, error, type, ...props }, ref) => {
const inputId = React.useId();
return (jsxs("div", { className: "space-y-2", children: [label && (jsx("label", { htmlFor: inputId, className: "block text-sm font-medium text-gray-700", children: label })), jsx("input", { type: type, id: inputId, className: cn("flex h-10 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", error && "border-red-500 focus-visible:ring-red-500", className), ref: ref, ...props }), error && jsx("p", { className: "text-sm text-red-600", children: error }), helperText && !error && (jsx("p", { className: "text-sm text-gray-500", children: helperText }))] }));
});
Input.displayName = "Input";
export { Input };
//# sourceMappingURL=Input.js.map