@@ -157,6 +157,7 @@ export const Banner = React.forwardRef<HTMLElement, BannerProps>(function Banner
157157 return (
158158 < BannerContext . Provider value = { { titleId} } >
159159 < section
160+ data-component = "Banner"
160161 { ...rest }
161162 aria-labelledby = { labelledBy ?? ( label ? undefined : titleId ) }
162163 aria-label = { labelledBy ? undefined : label }
@@ -171,9 +172,11 @@ export const Banner = React.forwardRef<HTMLElement, BannerProps>(function Banner
171172 data-layout = { rest . layout || 'default' }
172173 data-flush = { flush ? '' : undefined }
173174 >
174- < div className = { classes . BannerIcon } > { visual && supportsCustomIcon ? visual : iconForVariant [ variant ] } </ div >
175+ < div data-component = "Banner.Icon" className = { classes . BannerIcon } >
176+ { visual && supportsCustomIcon ? visual : iconForVariant [ variant ] }
177+ </ div >
175178 < div className = { classes . BannerContainer } >
176- < div className = { classes . BannerContent } >
179+ < div data-component = "Banner.Content" className = { classes . BannerContent } >
177180 { title ? (
178181 hideTitle ? (
179182 < VisuallyHidden >
@@ -215,7 +218,13 @@ export function BannerTitle<As extends HeadingElement>(props: BannerTitleProps<A
215218 const titleId = id ?? context ?. titleId
216219
217220 return (
218- < Heading { ...rest } id = { titleId } className = { clsx ( className , classes . BannerTitle ) } data-banner-title = "" >
221+ < Heading
222+ { ...rest }
223+ id = { titleId }
224+ className = { clsx ( className , classes . BannerTitle ) }
225+ data-component = "Banner.Title"
226+ data-banner-title = ""
227+ >
219228 { children }
220229 </ Heading >
221230 )
@@ -225,7 +234,7 @@ export type BannerDescriptionProps = React.ComponentPropsWithoutRef<'div'>
225234
226235export function BannerDescription ( { children, className, ...rest } : BannerDescriptionProps ) {
227236 return (
228- < div { ...rest } className = { clsx ( 'BannerDescription' , className ) } >
237+ < div { ...rest } className = { clsx ( 'BannerDescription' , className ) } data-component = "Banner.Description" >
229238 { children }
230239 </ div >
231240 )
@@ -238,7 +247,7 @@ export type BannerActionsProps = {
238247
239248export function BannerActions ( { primaryAction, secondaryAction} : BannerActionsProps ) {
240249 return (
241- < div className = { classes . BannerActions } >
250+ < div className = { classes . BannerActions } data-component = "Banner.Actions" >
242251 < div className = { classes . BannerActionsContainer } data-primary-action = "trailing" >
243252 { secondaryAction ?? null }
244253 { primaryAction ?? null }
@@ -255,7 +264,13 @@ export type BannerPrimaryActionProps = Omit<ButtonProps, 'variant'>
255264
256265const BannerPrimaryAction = forwardRef ( ( { children, className, ...rest } , forwardedRef ) => {
257266 return (
258- < Button ref = { forwardedRef } className = { clsx ( 'BannerPrimaryAction' , className ) } variant = "default" { ...rest } >
267+ < Button
268+ data-component = "Banner.PrimaryAction"
269+ ref = { forwardedRef }
270+ className = { clsx ( 'BannerPrimaryAction' , className ) }
271+ variant = "default"
272+ { ...rest }
273+ >
259274 { children }
260275 </ Button >
261276 )
@@ -267,7 +282,13 @@ export type BannerSecondaryActionProps = Omit<ButtonProps, 'variant'>
267282
268283const BannerSecondaryAction = forwardRef ( ( { children, className, ...rest } , forwardedRef ) => {
269284 return (
270- < Button ref = { forwardedRef } className = { clsx ( 'BannerPrimaryAction' , className ) } variant = "invisible" { ...rest } >
285+ < Button
286+ data-component = "Banner.SecondaryAction"
287+ ref = { forwardedRef }
288+ className = { clsx ( 'BannerPrimaryAction' , className ) }
289+ variant = "invisible"
290+ { ...rest }
291+ >
271292 { children }
272293 </ Button >
273294 )
0 commit comments