From 1def061ccc43b14c5aa826d61ecb8128d1dc8d08 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 3 Jan 2025 16:35:23 +0100 Subject: [PATCH] UI: fix input base, use mathematical asterisk in required label --- .../app/src/components/inputBase/index.tsx | 83 +++++++++++-------- 1 file changed, 49 insertions(+), 34 deletions(-) diff --git a/pkgs/webview-ui/app/src/components/inputBase/index.tsx b/pkgs/webview-ui/app/src/components/inputBase/index.tsx index 39780146d..eda2298ff 100644 --- a/pkgs/webview-ui/app/src/components/inputBase/index.tsx +++ b/pkgs/webview-ui/app/src/components/inputBase/index.tsx @@ -3,9 +3,9 @@ import { JSX, Ref, Show, splitProps } from "solid-js"; import Icon, { IconVariant } from "../icon"; import { Typography, TypographyProps } from "../Typography"; -type Variants = "outlined" | "ghost"; +export type InputVariant = "outlined" | "ghost"; interface InputBaseProps { - variant?: Variants; + variant?: InputVariant; value?: string; inputProps?: JSX.InputHTMLAttributes; required?: boolean; @@ -22,7 +22,7 @@ interface InputBaseProps { divRef?: Ref; } -const variantBorder: Record = { +const variantBorder: Record = { outlined: "border border-inv-3", ghost: "", }; @@ -115,40 +115,55 @@ export const InputLabel = (props: InputLabelProps) => { class={cx("flex items-center gap-1", labelProps.class)} {...forwardProps} > - - {props.children} - {props.required && ( - - {"*"} - - )} - {props.help && ( - + + - - - )} - + {props.children} + + {props.required && ( + + {"∗"} + + )} + {props.help && ( + + + + )} + + + {props.description} + + {props.labelAction} - - {props.description} - ); };