mirror of
https://github.com/langgenius/dify.git
synced 2026-06-07 16:32:01 +08:00
32 lines
807 B
TypeScript
32 lines
807 B
TypeScript
'use client'
|
|
|
|
import type { Input as BaseInputNS } from '@base-ui/react/input'
|
|
import type { VariantProps } from 'class-variance-authority'
|
|
import { Input as BaseInput } from '@base-ui/react/input'
|
|
import { cn } from '../cn'
|
|
import { textControlVariants } from '../form-control-shared'
|
|
|
|
export type InputSize = NonNullable<VariantProps<typeof textControlVariants>['size']>
|
|
|
|
export type InputProps
|
|
= Omit<BaseInputNS.Props, 'className' | 'size'>
|
|
& VariantProps<typeof textControlVariants>
|
|
& {
|
|
className?: string
|
|
}
|
|
|
|
export type InputChangeEventDetails = BaseInputNS.ChangeEventDetails
|
|
|
|
export function Input({
|
|
className,
|
|
size = 'medium',
|
|
...props
|
|
}: InputProps) {
|
|
return (
|
|
<BaseInput
|
|
className={cn(textControlVariants({ size }), className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|