Initial OSS commit
This commit is contained in:
commit
4a7303f40a
391 changed files with 245738 additions and 0 deletions
22
packages/plugin-r3f/src/components/elements/Input.tsx
Normal file
22
packages/plugin-r3f/src/components/elements/Input.tsx
Normal file
|
@ -0,0 +1,22 @@
|
|||
import React, {forwardRef} from 'react'
|
||||
import {Input as InputImpl} from 'reakit'
|
||||
import type {InputProps} from 'reakit'
|
||||
import {useFormControlContext} from './FormControl'
|
||||
|
||||
export type {InputProps}
|
||||
|
||||
const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {
|
||||
const id = useFormControlContext()
|
||||
|
||||
return (
|
||||
<InputImpl
|
||||
// @ts-ignore
|
||||
ref={ref}
|
||||
{...props}
|
||||
id={props.id ?? id}
|
||||
className={`${props.className} w-full h-8 px-3 border rounded-sm focus:outline-none focus:ring focus:ring-blue-300`}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
export default Input
|
Loading…
Add table
Add a link
Reference in a new issue