import type { PolymorphicProps } from '@kobalte/core/polymorphic'; import type { TextFieldDescriptionProps, TextFieldErrorMessageProps, TextFieldInputProps, TextFieldLabelProps, TextFieldRootProps, } from '@kobalte/core/text-field'; import type { ValidComponent, VoidProps } from 'solid-js'; import { cn } from '@/modules/ui/utils/cn'; import { TextField as TextFieldPrimitive } from '@kobalte/core/text-field'; import { cva } from 'class-variance-authority'; import { splitProps } from 'solid-js'; type textFieldProps = TextFieldRootProps & { class?: string; }; export function 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 function TextFieldLabel(props: PolymorphicProps>) { const [local, rest] = splitProps(props as textFieldLabelProps, ['class']); return ( ); } type textFieldErrorMessageProps = TextFieldErrorMessageProps & { class?: string; }; export function TextFieldErrorMessage(props: PolymorphicProps>) { const [local, rest] = splitProps(props as textFieldErrorMessageProps, [ 'class', ]); return ( ); } type textFieldDescriptionProps = TextFieldDescriptionProps & { class?: string; }; export function TextFieldDescription(props: PolymorphicProps>) { const [local, rest] = splitProps(props as textFieldDescriptionProps, [ 'class', ]); return ( ); } type textFieldInputProps = VoidProps< TextFieldInputProps & { class?: string; } >; export function TextField(props: PolymorphicProps>) { const [local, rest] = splitProps(props as textFieldInputProps, ['class']); return ( ); }