Function
InputGroupAddon
({
className,
align = "inline-start",
...props
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>)
Source from the content-addressed store, hash-verified
| 54 | ); |
| 55 | |
| 56 | function InputGroupAddon({ |
| 57 | className, |
| 58 | align = "inline-start", |
| 59 | ...props |
| 60 | }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) { |
| 61 | return ( |
| 62 | <div |
| 63 | role="group" |
| 64 | data-slot="input-group-addon" |
| 65 | data-align={align} |
| 66 | className={cn(inputGroupAddonVariants({ align }), className)} |
| 67 | onClick={(e) => { |
| 68 | if ((e.target as HTMLElement).closest("button")) { |
| 69 | return; |
| 70 | } |
| 71 | e.currentTarget.parentElement?.querySelector("input")?.focus(); |
| 72 | }} |
| 73 | {...props} |
| 74 | /> |
| 75 | ); |
| 76 | } |
| 77 | |
| 78 | const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", { |
| 79 | variants: { |
Callers
nothing calls this directly
Tested by
no test coverage detected