import { composeEventHandlers } from "@radix-ui/primitive" import clsx from "clsx" import type { ComponentProps } from "react" import { SvgUse } from "../../shared/SvgUse" import { Input, InputAdornment, InputAdornmentButton, InputControl, InputRoot } from "../input" import { InputPasswordPrimitive } from "../input-password-primitive" import { usePasswordInputContext } from "../input-password-primitive/input-password-primitive" export type PasswordInputProps = ComponentProps & ComponentProps & { error?: boolean size?: "sm" | "md" | "lg" } export const PasswordInput = ({ visible, defaultVisible, onVisibleChange, error, size = "md", className, ...props }: PasswordInputProps) => ( ) PasswordInput.displayName = "PasswordInput" export const PasswordInputAdornment = InputAdornment export const PasswordInputInput = ({ ref, ...props }: ComponentProps) => ( ) PasswordInputInput.displayName = "PasswordInputInput" export const PasswordInputAdornmentToggle = ({ className, onClick, ...props }: ComponentProps) => { const { visible, onVisibleChange } = usePasswordInputContext() return ( onVisibleChange(!visible))} className={clsx("group", className)} {...props} > ) } PasswordInputAdornmentToggle.displayName = "PasswordInputAdornmentToggle"