@@ -50,7 +50,7 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
5050 transition = { { duration : 0.2 , ease : "easeOut" } }
5151 >
5252 { status === "available" && (
53- < div className = "flex items-center gap-1" >
53+ < div className = "group flex items-center gap-1" >
5454 < button
5555 type = "button"
5656 className = "flex items-center gap-1.5 rounded-2 border border-(--green-a5) bg-(--green-a3) px-2.5 py-1 font-medium text-(--green-11) text-[13px] transition-colors hover:bg-(--green-a4)"
@@ -77,7 +77,7 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
7777 ) }
7878
7979 { status === "ready" && (
80- < div className = "flex items-center gap-1" >
80+ < div className = "group flex items-center gap-1" >
8181 < button
8282 type = "button"
8383 className = "flex items-center gap-1.5 rounded-2 border border-(--green-a5) bg-(--green-a3) px-2.5 py-1 font-medium text-(--green-11) text-[13px] transition-colors hover:bg-(--green-a4)"
@@ -119,7 +119,7 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
119119 < AnimatePresence mode = "wait" >
120120 { status === "available" && (
121121 < BannerCard key = "available" >
122- < div className = "flex w-full items-center gap-3 rounded-md border border-[var(--green-a5)] bg-[var(--green-a3)] px-3 py-2.5 text-[13px] text-[var(--green-11)]" >
122+ < div className = "group relative flex w-full items-center gap-3 rounded-md border border-[var(--green-a5)] bg-[var(--green-a3)] px-3 py-2.5 text-[13px] text-[var(--green-11)]" >
123123 < Gift size = { 20 } weight = "duotone" className = "shrink-0" />
124124 < button
125125 type = "button"
@@ -143,7 +143,10 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
143143 View
144144 </ button >
145145 { canDismiss && (
146- < DismissButton onClick = { ( ) => dismissBanner ( dismissKey ) } />
146+ < DismissButton
147+ variant = "overlay"
148+ onClick = { ( ) => dismissBanner ( dismissKey ) }
149+ />
147150 ) }
148151 </ div >
149152 </ BannerCard >
@@ -174,7 +177,7 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
174177
175178 { status === "ready" && (
176179 < BannerCard key = "ready" >
177- < div className = "flex w-full items-center gap-3 rounded-md border border-[var(--green-a5)] bg-[var(--green-a3)] px-3 py-2.5 text-[13px] text-[var(--green-11)]" >
180+ < div className = "group relative flex w-full items-center gap-3 rounded-md border border-[var(--green-a5)] bg-[var(--green-a3)] px-3 py-2.5 text-[13px] text-[var(--green-11)]" >
178181 < motion . div
179182 className = "shrink-0"
180183 animate = { { rotate : [ 0 , - 12 , 12 , - 8 , 8 , - 4 , 0 ] } }
@@ -207,7 +210,10 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
207210 Restart
208211 </ button >
209212 { canDismiss && (
210- < DismissButton onClick = { ( ) => dismissBanner ( dismissKey ) } />
213+ < DismissButton
214+ variant = "overlay"
215+ onClick = { ( ) => dismissBanner ( dismissKey ) }
216+ />
211217 ) }
212218 </ div >
213219 </ BannerCard >
@@ -231,16 +237,27 @@ export function UpdateBanner({ variant = "sidebar" }: UpdateBannerProps) {
231237 ) ;
232238}
233239
234- function DismissButton ( { onClick } : { onClick : ( ) => void } ) {
240+ function DismissButton ( {
241+ onClick,
242+ variant = "inline" ,
243+ } : {
244+ onClick : ( ) => void ;
245+ variant ?: "inline" | "overlay" ;
246+ } ) {
247+ const className =
248+ variant === "overlay"
249+ ? "absolute -top-1.5 -right-1.5 rounded-full border border-(--green-a5) bg-(--gray-2) p-1 text-(--green-11) opacity-0 transition-all focus-visible:opacity-100 group-hover:opacity-100 hover:bg-(--green-a4)"
250+ : "shrink-0 rounded-2 p-1 text-(--green-a11) opacity-0 transition-all focus-visible:opacity-100 group-hover:opacity-100 hover:bg-(--green-a4) hover:text-(--green-11)" ;
251+
235252 return (
236253 < button
237254 type = "button"
238255 aria-label = "Dismiss update banner"
239256 title = "Dismiss"
240- className = "shrink-0 rounded-2 p-1 text-(--green-a11) transition-colors hover:bg-(--green-a4) hover:text-(--green-11)"
257+ className = { className }
241258 onClick = { onClick }
242259 >
243- < X size = { 12 } weight = "bold" />
260+ < X size = { variant === "overlay" ? 10 : 12 } weight = "bold" />
244261 </ button >
245262 ) ;
246263}
0 commit comments