import { TextField as KTextField } from "@kobalte/core"; import { Show, splitProps, type JSX } from "solid-js"; import { TinyText } from "~/components"; export type TextFieldProps = { name: string; type?: "text" | "email" | "tel" | "password" | "url" | "date"; label?: string; placeholder?: string; caption?: string; value: string | undefined; error: string; required?: boolean; multiline?: boolean; disabled?: boolean; autoCapitalize?: string; ref: (element: HTMLInputElement | HTMLTextAreaElement) => void; onInput: JSX.EventHandler< HTMLInputElement | HTMLTextAreaElement, InputEvent >; onChange: JSX.EventHandler; onBlur: JSX.EventHandler< HTMLInputElement | HTMLTextAreaElement, FocusEvent >; }; export function TextField(props: TextFieldProps) { const [fieldProps] = splitProps(props, [ "placeholder", "ref", "onInput", "onChange", "onBlur", "autoCapitalize" ]); return ( {props.label} } > { // @ts-expect-error autocapitalize isn't in the props for some reason } {props.error} {props.caption} ); }