File tree Expand file tree Collapse file tree 1 file changed +32
-26
lines changed
application/shared-webapp/ui/components Expand file tree Collapse file tree 1 file changed +32
-26
lines changed Original file line number Diff line number Diff line change @@ -49,33 +49,39 @@ export function Input({
4949 startIcon,
5050 ...props
5151} : Readonly < InputProps > ) {
52- return (
53- < div className = { isEmbedded ? "relative flex-1" : "relative" } >
54- { startIcon && (
52+ const inputElement = (
53+ < AriaInput
54+ { ...props }
55+ disabled = { isDisabled }
56+ readOnly = { isReadOnly }
57+ type = { type }
58+ className = { composeRenderProps (
59+ className ,
60+ ( className , { isFocusVisible, isDisabled, ...renderProps } ) =>
61+ `${ inputStyles ( {
62+ ...renderProps ,
63+ isFile : type === "file" ,
64+ isFocusVisible : isEmbedded ? false : isFocusVisible ,
65+ isEmbedded,
66+ isDisabled,
67+ isReadOnly,
68+ hasStartIcon : ! ! startIcon ,
69+ className
70+ } ) } ${ isDisabled || isReadOnly ? "border-input" : "" } `
71+ ) }
72+ />
73+ ) ;
74+
75+ if ( startIcon ) {
76+ return (
77+ < div className = "relative" >
5578 < div className = "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3 flex items-center" >
5679 { startIcon }
5780 </ div >
58- ) }
59- < AriaInput
60- { ...props }
61- disabled = { isDisabled }
62- readOnly = { isReadOnly }
63- type = { type }
64- className = { composeRenderProps (
65- className ,
66- ( className , { isFocusVisible, isDisabled, ...renderProps } ) =>
67- `${ inputStyles ( {
68- ...renderProps ,
69- isFile : type === "file" ,
70- isFocusVisible : isEmbedded ? false : isFocusVisible ,
71- isEmbedded,
72- isDisabled,
73- isReadOnly,
74- hasStartIcon : ! ! startIcon ,
75- className
76- } ) } ${ isDisabled || isReadOnly ? "border-input" : "" } `
77- ) }
78- />
79- </ div >
80- ) ;
81+ { inputElement }
82+ </ div >
83+ ) ;
84+ }
85+
86+ return inputElement ;
8187}
You can’t perform that action at this time.
0 commit comments