MCPcopy Create free account
hub / github.com/arctic-cli/interface / InputGroupAddon

Function InputGroupAddon

packages/web/components/ui/input-group.tsx:45–71  ·  view source on GitHub ↗
({
  className,
  align = "inline-start",
  ...props
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>)

Source from the content-addressed store, hash-verified

43);
44
45function InputGroupAddon({
46 className,
47 align = "inline-start",
48 ...props
49}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
50 return (
51 <div
52 className={cn(inputGroupAddonVariants({ align }), className)}
53 data-align={align}
54 data-slot="input-group-addon"
55 onMouseDown={(e) => {
56 const target = e.target as HTMLElement;
57 const isInteractive = target.closest("button, a");
58 if (isInteractive) return;
59 e.preventDefault();
60 const parent = e.currentTarget.parentElement;
61 const input = parent?.querySelector<
62 HTMLInputElement | HTMLTextAreaElement
63 >("input, textarea");
64 if (input && !parent?.querySelector("input:focus, textarea:focus")) {
65 input.focus();
66 }
67 }}
68 {...props}
69 />
70 );
71}
72
73function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
74 return (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected