input.tsx 866 B

123456789101112131415161718192021222324252627
  1. import * as React from 'react';
  2. import { cn } from '@/lib/utils';
  3. export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
  4. const Input = React.forwardRef<HTMLInputElement, InputProps>(
  5. ({ className, type, ...props }, ref) => {
  6. return (
  7. <input
  8. type={type}
  9. className={cn(
  10. 'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm',
  11. 'ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium',
  12. 'placeholder:text-muted-foreground',
  13. 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
  14. 'disabled:cursor-not-allowed disabled:opacity-50',
  15. className
  16. )}
  17. ref={ref}
  18. {...props}
  19. />
  20. );
  21. }
  22. );
  23. Input.displayName = 'Input';
  24. export { Input };