feat(admin-ui): shadcn primitives + @/ui barrel (Stage 2.1)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import * as React from 'react'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* Text input — single-line. Использует наши tokens, focus-ring через accent.
|
||||
*
|
||||
* Wrap'итесь в {@code <Label>} выше для accessibility. Для search input'а
|
||||
* с иконкой см. {@link SearchInput}.
|
||||
*/
|
||||
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>
|
||||
|
||||
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
function Input({ className, type = 'text', ...props }, ref) {
|
||||
return (
|
||||
<input
|
||||
ref={ref}
|
||||
type={type}
|
||||
className={cn(
|
||||
'flex h-9 w-full rounded-md border border-line bg-surface px-3 py-1 text-sm text-ink',
|
||||
'placeholder:text-mute',
|
||||
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-bg',
|
||||
'disabled:cursor-not-allowed disabled:opacity-50',
|
||||
'file:border-0 file:bg-transparent file:text-sm file:font-medium',
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user