feat: continue moving older components to aria
This commit is contained in:
parent
ee42016a67
commit
87430ccf7b
17 changed files with 184 additions and 186 deletions
|
|
@ -9,7 +9,7 @@ import { cn } from '~/utils/cn'
|
|||
type TextFieldProperties = Parameters<typeof AriaTextField>[0] & {
|
||||
readonly label: string;
|
||||
readonly placeholder: string;
|
||||
readonly state: [string, Dispatch<SetStateAction<string>>];
|
||||
readonly state?: [string, Dispatch<SetStateAction<string>>];
|
||||
}
|
||||
|
||||
export default function TextField(properties: TextFieldProperties) {
|
||||
|
|
@ -21,7 +21,7 @@ export default function TextField(properties: TextFieldProperties) {
|
|||
>
|
||||
<Input
|
||||
placeholder={properties.placeholder}
|
||||
value={properties.state[0]}
|
||||
value={properties.state?.[0]}
|
||||
name={properties.name}
|
||||
className={cn(
|
||||
'block px-2.5 py-1.5 w-full rounded-lg my-1',
|
||||
|
|
@ -30,7 +30,7 @@ export default function TextField(properties: TextFieldProperties) {
|
|||
properties.className
|
||||
)}
|
||||
onChange={event => {
|
||||
properties.state[1](event.target.value)
|
||||
properties.state?.[1](event.target.value)
|
||||
}}
|
||||
/>
|
||||
</AriaTextField>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue