@@ -47,6 +47,10 @@ template(v-else)
4747import { computed , h , getCurrentInstance , resolveComponent } from ' vue' ;
4848import styles from ' @polaris/components/Banner/Banner.module.css' ;
4949import useI18n from ' @/use/useI18n' ;
50+ import { Text } from ' @/components' ;
51+ import WithinContentContainerBanner from ' ./WithinContentContainerBanner.vue' ;
52+ import InlineIconBanner from ' ./InlineIconBanner.vue' ;
53+ import DefaultBanner from ' ./DefaultBanner.vue' ;
5054import type { VueNode } from ' @/utilities/types' ;
5155import { useHasSlot } from ' @/use/useHasSlot' ;
5256import XIcon from ' @icons/XIcon.svg' ;
@@ -96,24 +100,24 @@ const sharedBannerProps = computed(() => {
96100 }
97101});
98102
99- const bannerTitle = computed (() =>
100- props . title ? () => h (
103+ const bannerTitle = props . title
104+ ? h (
101105 resolveComponent (' Text' ),
102106 { variant: ' headingSm' , as: ' h2' , breakWord: true },
103107 () => props .title ,
104- ) : null ,
105- ) ;
108+ )
109+ : undefined ;
106110
107- const bannerIcon = computed (() =>
108- ! props . hideIcon ? () => h (
111+ const bannerIcon = ! props . hideIcon
112+ ? h (
109113 ' span' ,
110114 { class: styles [bannerColors .value .icon ] },
111115 h (resolveComponent (' Icon' ), { source: props .icon || bannerAttributes [bannerTone .value ].icon , }),
112- ) : null ,
113- ) ;
116+ )
117+ : undefined ;
114118
115- const actionButtons = computed (() =>
116- ( props . action || props . secondaryAction ) ? () => h (
119+ const actionButtons = ( props . action || props . secondaryAction )
120+ ? h (
117121 resolveComponent (' ButtonGroup' ),
118122 () => [
119123 props .action && h (resolveComponent (' Button' ),
@@ -125,13 +129,13 @@ const actionButtons = computed(() =>
125129 () => props .secondaryAction ?.content ,
126130 ),
127131 ],
128- ) : null ,
129- ) ;
132+ )
133+ : undefined ;
130134
131135const hasDismiss = computed (() => Boolean (currentInstance ?.vnode .props ?.onDismiss ));
132136
133- const dismissButton = computed (() =>
134- hasDismiss . value ? () => h (
137+ const dismissButton = hasDismiss . value
138+ ? h (
135139 resolveComponent (' Button' ),
136140 {
137141 variant: ' tertiary' ,
@@ -143,6 +147,6 @@ const dismissButton = computed(() =>
143147 onClick : () => emits (' dismiss' ),
144148 accessibilityLabel: i18n .translate (' Polaris.Banner.dismissButton' ),
145149 },
146- ) : null ,
147- ) ;
150+ )
151+ : undefined ;
148152 </script >
0 commit comments