|
1
|
import React from "react" |
|
2
|
import clsx from "clsx" |
|
3
|
|
|
4
|
export type InputTextProps = { |
|
5
|
className?: string |
|
6
|
addGroupStyling?: boolean |
|
7
|
passedRef?: React.Ref<HTMLInputElement> |
|
8
|
} & React.DetailedHTMLProps< |
|
9
|
React.InputHTMLAttributes<HTMLInputElement>, |
|
10
|
HTMLInputElement |
|
11
|
> |
|
12
|
|
|
13
|
export const InputText = ({ |
|
14
|
addGroupStyling = false, |
|
15
|
className, |
|
16
|
passedRef, |
|
17
|
...props |
|
18
|
}: InputTextProps) => { |
|
19
|
return ( |
|
20
|
<input |
|
21
|
{...props} |
|
22
|
className={clsx( |
|
23
|
"bg-medusa-bg-field-component shadow-border-base dark:shadow-border-base-dark", |
|
24
|
"rounded-docs_sm px-docs_0.5", |
|
25
|
"hover:bg-medusa-bg-field-component-hover", |
|
26
|
addGroupStyling && "group-hover:bg-medusa-bg-field-component-hover", |
|
27
|
"focus:border-medusa-border-interactive", |
|
28
|
"active:border-medusa-border-interactive", |
|
29
|
"disabled:bg-medusa-bg-disabled", |
|
30
|
"disabled:border-medusa-border-base", |
|
31
|
"placeholder:text-medusa-fg-muted", |
|
32
|
"disabled:placeholder:text-medusa-fg-disabled", |
|
33
|
"text-compact-small font-base", |
|
34
|
className |
|
35
|
)} |
|
36
|
ref={passedRef} |
|
37
|
/> |
|
38
|
) |
|
39
|
} |