26 lines
699 B
TypeScript
26 lines
699 B
TypeScript
import * as React from "react"
|
|
|
|
import { cn } from "@/lib/utils"
|
|
import { inputRecipe, type ControlSize } from "@/design-system/recipes"
|
|
|
|
export interface InputProps extends React.ComponentProps<"input"> {
|
|
// Размер контрола из дизайн-системы (по умолчанию md — прежний вид)
|
|
controlSize?: ControlSize
|
|
}
|
|
|
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
({ className, type, controlSize, ...props }, ref) => {
|
|
return (
|
|
<input
|
|
type={type}
|
|
className={cn(inputRecipe({ size: controlSize }), className)}
|
|
ref={ref}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
)
|
|
Input.displayName = "Input"
|
|
|
|
export { Input }
|