@@ -15,6 +15,7 @@ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component
1515import { usePrevious } from '../internal/hooks/use-previous' ;
1616import { SomeRequired } from '../internal/types' ;
1717import InternalLiveRegion from '../live-region/internal' ;
18+ import InternalSpaceBetween from '../space-between/internal' ;
1819import { AdditionalInfo } from './additional-info' ;
1920import { gridDefaults } from './grid-defaults' ;
2021import { AttributeEditorForwardRefType , AttributeEditorProps } from './interfaces' ;
@@ -45,6 +46,8 @@ const InternalAttributeEditor = React.forwardRef(
4546 onAddButtonClick,
4647 onRemoveButtonClick,
4748 __internalRootRef,
49+ hideAddButton,
50+ additionalActions,
4851 ...props
4952 } : InternalAttributeEditorProps < T > ,
5053 ref : React . Ref < AttributeEditorProps . Ref >
@@ -153,24 +156,31 @@ const InternalAttributeEditor = React.forwardRef(
153156 ) ) }
154157
155158 < div className = { styles [ 'add-row' ] } >
156- < InternalButton
157- className = { styles [ 'add-button' ] }
158- disabled = { disableAddButton }
159- // Using aria-disabled="true" and tabindex="-1" instead of "disabled"
160- // because focus can be dynamically moved to this button by calling
161- // `focusAddButton()` on the ref.
162- nativeButtonAttributes = { disableAddButton ? { tabIndex : - 1 } : { } }
163- __skipNativeAttributesWarnings = { true }
164- __focusable = { true }
165- onClick = { onAddButtonClick }
166- formAction = "none"
167- ref = { addButtonRef }
168- ariaDescribedby = { infoAriaDescribedBy }
169- variant = { addButtonVariant }
170- iconName = { addButtonVariant === 'inline-link' ? 'add-plus' : undefined }
171- >
172- { addButtonText }
173- </ InternalButton >
159+ { ( ! hideAddButton || additionalActions ) && (
160+ < InternalSpaceBetween size = "xs" direction = "horizontal" >
161+ { ! hideAddButton && (
162+ < InternalButton
163+ className = { styles [ 'add-button' ] }
164+ disabled = { disableAddButton }
165+ // Using aria-disabled="true" and tabindex="-1" instead of "disabled"
166+ // because focus can be dynamically moved to this button by calling
167+ // `focusAddButton()` on the ref.
168+ nativeButtonAttributes = { disableAddButton ? { tabIndex : - 1 } : { } }
169+ __skipNativeAttributesWarnings = { true }
170+ __focusable = { true }
171+ onClick = { onAddButtonClick }
172+ formAction = "none"
173+ ref = { addButtonRef }
174+ ariaDescribedby = { infoAriaDescribedBy }
175+ variant = { addButtonVariant }
176+ iconName = { addButtonVariant === 'inline-link' ? 'add-plus' : undefined }
177+ >
178+ { addButtonText }
179+ </ InternalButton >
180+ ) }
181+ { additionalActions }
182+ </ InternalSpaceBetween >
183+ ) }
174184 < InternalLiveRegion
175185 data-testid = "removal-announcement"
176186 tagName = "span"
0 commit comments