Skip to content

Commit

Permalink
Fix passing variants into BasicInput (#12398)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount authored Mar 4, 2025
1 parent acb6373 commit adadc9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import { forwardRef } from '#/utilities/react'
import type { VariantProps } from '#/utilities/tailwindVariants'
import { tv } from '#/utilities/tailwindVariants'
import {
BasicInput,
Button,
Form,
Popover,
Text,
UncontrolledInput,
type FieldComponentProps,
type FieldPath,
type FieldProps,
Expand Down Expand Up @@ -164,7 +164,7 @@ export const ComboBox = forwardRef(function ComboBox<
>
<div ref={popoverTriggerRef} className={styles.inputContainer()}>
<Button variant="icon" icon={ArrowIcon} className="rotate-90" />
<UncontrolledInput
<BasicInput
name={name}
placeholder={placeholder}
addonStart={addonStart}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,19 @@ export const Input = forwardRef(function Input<
name={name}
data-testid={testId}
>
<UncontrolledInput
{...aria.mergeProps<UncontrolledInputProps>()(
<BasicInput
{...aria.mergeProps<BasicInputProps>()(
{
className: (classNameStates) =>
classes.textArea({ className: computedClassName(classNameStates) }),
type,
name,
isInvalid: invalid,
isDisabled: disabled,
variant,
size,
rounded,
variants,
},
omit(inputProps, 'isInvalid', 'isRequired', 'isDisabled'),
omit(fieldProps, 'isInvalid', 'isRequired', 'isDisabled', 'invalid'),
Expand All @@ -160,8 +164,8 @@ export const Input = forwardRef(function Input<
)
})

/** Props for an {@link UncontrolledInput}. */
export interface UncontrolledInputProps
/** Props for an {@link BasicInput}. */
export interface BasicInputProps
extends Omit<aria.InputProps, 'children' | 'size'>,
Omit<VariantProps<typeof INPUT_STYLES>, 'disabled' | 'invalid'>,
TestIdProps {
Expand All @@ -178,8 +182,8 @@ export interface UncontrolledInputProps
}

/** An input without a {@link Form.Field}. */
export const UncontrolledInput = forwardRef(function UncontrolledInput(
props: UncontrolledInputProps,
export const BasicInput = forwardRef(function BasicInput(
props: BasicInputProps,
ref?: Ref<HTMLInputElement>,
) {
const {
Expand Down

0 comments on commit adadc9b

Please sign in to comment.