diff --git a/pkgs/webview-ui/app/src/Form/fields/TextInput.tsx b/pkgs/webview-ui/app/src/Form/fields/TextInput.tsx index 74640f345..c37214b30 100644 --- a/pkgs/webview-ui/app/src/Form/fields/TextInput.tsx +++ b/pkgs/webview-ui/app/src/Form/fields/TextInput.tsx @@ -1,62 +1,51 @@ -import { createEffect, Show, type JSX } from "solid-js"; -import cx from "classnames"; -import { Label } from "../base/label"; -import { InputBase, InputLabel } from "@/src/components/inputBase"; +import { splitProps, type JSX } from "solid-js"; +import { InputBase, InputError, InputLabel } from "@/src/components/inputBase"; import { Typography } from "@/src/components/Typography"; +import { FieldLayout } from "./layout"; interface TextInputProps { - value: string; - inputProps?: JSX.InputHTMLAttributes; - label: JSX.Element; - altLabel?: JSX.Element; - helperText?: JSX.Element; + // Common error?: string; required?: boolean; - type?: string; - inlineLabel?: JSX.Element; - class?: string; - adornment?: { - position: "start" | "end"; - content: JSX.Element; - }; disabled?: boolean; + // Passed to input + value: string; + inputProps?: JSX.InputHTMLAttributes; placeholder?: string; + // Passed to label + label: JSX.Element; + help?: string; + // Passed to layouad + class?: string; } export function TextInput(props: TextInputProps) { - // createEffect(() => { - // console.log("TextInput", props.error, props.value); - // }); + const [layoutProps, rest] = splitProps(props, ["class"]); return ( -
- - {props.label} - - - {props.error && ( - - {props.error} - - )} -
+ {props.label} + + } + field={ + + } + error={props.error && } + {...layoutProps} + /> ); }