Yardımcılar
mergeProps, composeRefs, core yardımcılar ve varsayılan ikonlar.
Core yardımcılar
import { getButtonAriaAttributes, getInputAriaAttributes, getInputType } from "@virastack/password"
getInputType(true) // "text"
getButtonAriaAttributes(false, "password", "Show password")
// { "aria-label": "Show password", "aria-pressed": false, "aria-controls": "password", type: "button" }
getInputAriaAttributes(true, "password-hint") // { "aria-invalid": true, "aria-describedby": "password-hint" }İkonlar
import { EyeIcon, EyeOffIcon } from "@virastack/password"
<EyeIcon width={20} className="text-muted-foreground" />mergeProps
import { mergeProps } from "@virastack/password"
<input {...mergeProps(inputProps, form.register("password", rule))} />
// on* handlerlar: ikisi de çalışır, önce ilk argüman
// className, aria-describedby: birleşir
// ref: birleşir
// diğerleri: sonraki değer kazanırcomposeRefs
import { composeRefs } from "@virastack/password"
<input ref={composeRefs(localRef, field.ref)} />
// nesne ref, callback ref ve React 19 ref temizliğini destekler