import { cn } from "@/modules/ui/utils/cn"; import type { PolymorphicProps } from "@kobalte/core/polymorphic"; import type { TextFieldDescriptionProps, TextFieldErrorMessageProps, TextFieldInputProps, TextFieldLabelProps, TextFieldRootProps, } from "@kobalte/core/text-field"; import { TextField as TextFieldPrimitive } from "@kobalte/core/text-field"; import { cva } from "class-variance-authority"; import type { ValidComponent, VoidProps } from "solid-js"; import { splitProps } from "solid-js"; type textFieldProps = TextFieldRootProps & { class?: string; }; export const TextFieldRoot = ( props: PolymorphicProps>, ) => { const [local, rest] = splitProps(props as textFieldProps, ["class"]); return ; }; export const textfieldLabel = cva( "text-sm data-[disabled]:(cursor-not-allowed opacity-70) font-medium", { variants: { label: { true: "data-[invalid]:text-destructive", }, error: { true: "text-destructive text-xs", }, description: { true: "font-normal text-muted-foreground", }, }, defaultVariants: { label: true, }, }, ); type textFieldLabelProps = TextFieldLabelProps & { class?: string; }; export const TextFieldLabel = ( props: PolymorphicProps>, ) => { const [local, rest] = splitProps(props as textFieldLabelProps, ["class"]); return ( ); }; type textFieldErrorMessageProps = TextFieldErrorMessageProps & { class?: string; }; export const TextFieldErrorMessage = ( props: PolymorphicProps>, ) => { const [local, rest] = splitProps(props as textFieldErrorMessageProps, [ "class", ]); return ( ); }; type textFieldDescriptionProps = TextFieldDescriptionProps & { class?: string; }; export const TextFieldDescription = ( props: PolymorphicProps>, ) => { const [local, rest] = splitProps(props as textFieldDescriptionProps, [ "class", ]); return ( ); }; type textFieldInputProps = VoidProps< TextFieldInputProps & { class?: string; } >; export const TextField = ( props: PolymorphicProps>, ) => { const [local, rest] = splitProps(props as textFieldInputProps, ["class"]); return ( ); };