@@ -56,58 +56,73 @@ export const PropertyBase = ({
5656 const isRemoveEnabled = allowRemove && ! readOnly
5757 const showActionsContainer = isClearEnabled || isRemoveEnabled
5858
59+ const renderActionButtons = ( ) => (
60+ < >
61+ { isClearEnabled && (
62+ < IconButton
63+ tooltip = { translation ( 'clearValue' ) }
64+ onClick = { onValueClear }
65+ disabled = { ! hasValue }
66+ color = "negative"
67+ coloringStyle = "text"
68+ size = "sm"
69+ >
70+ < X className = "size-force-5" />
71+ </ IconButton >
72+ ) }
73+ { isRemoveEnabled && (
74+ < IconButton
75+ tooltip = { translation ( 'removeProperty' ) }
76+ onClick = { onRemove }
77+ color = "negative"
78+ coloringStyle = "text"
79+ size = "sm"
80+ >
81+ < Trash className = "size-force-5" />
82+ </ IconButton >
83+ ) }
84+ </ >
85+ )
86+
5987 return (
6088 < div
61- className = { clsx ( 'group/property' , className ) }
89+ className = { clsx ( 'group/property min-w-0 w-full ' , className ) }
6290 data-name = "property-root"
6391 data-invalid = { PropsUtil . dataAttributes . bool ( invalid ) }
6492 >
65- < div
66- data-name = "property-title"
67- data-invalid = { PropsUtil . dataAttributes . bool ( invalid ) }
68- >
69- < Tooltip tooltip = { name } containerClassName = "min-w-0" >
70- < div className = "flex-row-1 items-center" >
71- < div data-name = "property-title-icon" > { icon } </ div >
72- < span data-name = "property-title-text" > { name } </ span >
73- </ div >
74- </ Tooltip >
75- { invalid && (
76- < AlertTriangle className = "size-force-6" />
77- ) }
78- </ div >
79- < div
80- data-name = "property-content"
81- data-invalid = { PropsUtil . dataAttributes . bool ( invalid ) }
82- >
83- { children ( { required, hasValue, invalid } ) }
84- { showActionsContainer && (
85- < div data-name = "property-actions" >
86- { isClearEnabled && (
87- < IconButton
88- tooltip = { translation ( 'clearValue' ) }
89- onClick = { onValueClear }
90- disabled = { ! hasValue }
91- color = "negative"
92- coloringStyle = "text"
93- size = "sm"
94- >
95- < X className = "size-force-5" />
96- </ IconButton >
97- ) }
98- { isRemoveEnabled && (
99- < IconButton
100- tooltip = { translation ( 'removeProperty' ) }
101- onClick = { onRemove }
102- color = "negative"
103- coloringStyle = "text"
104- size = "sm"
105- >
106- < Trash className = "size-force-5" />
107- </ IconButton >
93+ < div data-name = "property-inner" >
94+ < div
95+ data-name = "property-title"
96+ data-invalid = { PropsUtil . dataAttributes . bool ( invalid ) }
97+ >
98+ < div className = "flex min-w-0 flex-1 flex-row items-center justify-between gap-2" >
99+ < Tooltip tooltip = { name } containerClassName = "min-w-0" >
100+ < div className = "flex-row-1 items-center" >
101+ < div data-name = "property-title-icon" > { icon } </ div >
102+ < span data-name = "property-title-text" > { name } </ span >
103+ </ div >
104+ </ Tooltip >
105+ { invalid && (
106+ < AlertTriangle className = "size-force-6 shrink-0" />
108107 ) }
109108 </ div >
110- ) }
109+ { showActionsContainer && (
110+ < div data-name = "property-title-actions" >
111+ { renderActionButtons ( ) }
112+ </ div >
113+ ) }
114+ </ div >
115+ < div
116+ data-name = "property-content"
117+ data-invalid = { PropsUtil . dataAttributes . bool ( invalid ) }
118+ >
119+ { children ( { required, hasValue, invalid } ) }
120+ { showActionsContainer && (
121+ < div data-name = "property-actions" >
122+ { renderActionButtons ( ) }
123+ </ div >
124+ ) }
125+ </ div >
111126 </ div >
112127 </ div >
113128 )
0 commit comments