|
1
|
import { Input, Text } from "@medusajs/ui" |
|
2
|
import { |
|
3
|
ComponentProps, |
|
4
|
ElementRef, |
|
5
|
ForwardRefExoticComponent, |
|
6
|
PropsWithoutRef, |
|
7
|
RefAttributes, |
|
8
|
forwardRef, |
|
9
|
} from "react" |
|
10
|
|
|
11
|
export type HandleInputProps = ComponentProps<typeof Input> |
|
12
|
|
|
13
|
export const HandleInput: ForwardRefExoticComponent< |
|
14
|
PropsWithoutRef<HandleInputProps> & RefAttributes<ElementRef<typeof Input>> |
|
15
|
> = forwardRef<ElementRef<typeof Input>, HandleInputProps>((props, ref) => { |
|
16
|
return ( |
|
17
|
<div className="relative"> |
|
18
|
<div className="absolute inset-y-0 left-0 z-10 flex w-8 items-center justify-center border-r"> |
|
19
|
<Text |
|
20
|
className="text-ui-fg-muted" |
|
21
|
size="small" |
|
22
|
leading="compact" |
|
23
|
weight="plus" |
|
24
|
> |
|
25
|
/ |
|
26
|
</Text> |
|
27
|
</div> |
|
28
|
<Input ref={ref} {...props} className="pl-10" /> |
|
29
|
</div> |
|
30
|
) |
|
31
|
}) |
|
32
|
HandleInput.displayName = "HandleInput" |