11'use client' ;
22
3- import * as Tooltip from '@radix -ui/react- tooltip' ;
3+ import { Tooltip } from '@base -ui/react/ tooltip' ;
44
55import { cn } from '../../components/ui/cn' ;
66
@@ -21,59 +21,68 @@ type LifecycleTooltipProps = {
2121
2222export function LifecycleTooltip ( { entries, summary, size, showLabels } : LifecycleTooltipProps ) {
2323 return (
24- < Tooltip . Provider delayDuration = { 150 } >
24+ < Tooltip . Provider delay = { 150 } >
2525 < Tooltip . Root >
26- < Tooltip . Trigger asChild >
27- < span
28- role = "button"
29- aria-label = { `Lifecycle status: ${ summary } ` }
30- tabIndex = { 0 }
31- className = { cn (
32- 'border-bds-gray-10 focus-visible:ring-base-blue/30 inline-flex items-center rounded-full border bg-white/80 outline-none transition-colors focus-visible:ring-2 dark:border-white/10 dark:bg-white/10' ,
33- size === 'sm' ? 'gap-1 px-2 py-1' : 'gap-1.5 px-2.5 py-1.5' ,
34- ) }
35- >
36- { entries . map ( ( entry ) => (
37- < span key = { entry . networkKey } className = "inline-flex items-center gap-1" >
38- < span
39- className = { cn (
40- 'rounded-full ring-2 ring-black/5 dark:ring-white/10' ,
41- size === 'sm' ? 'h-2 w-2' : 'h-2.5 w-2.5' ,
42- entry . dotClassName ,
43- ) }
44- />
45- { showLabels ? (
46- < span className = "font-mono text-[11px] font-medium uppercase leading-[14px] tracking-[0px] text-[#787878] md:text-[12px] md:leading-[16px]" >
47- { entry . networkKey . slice ( 0 , 1 ) }
48- </ span >
49- ) : null }
50- </ span >
51- ) ) }
52- </ span >
26+ < Tooltip . Trigger
27+ type = "button"
28+ aria-label = { `Lifecycle status: ${ summary } ` }
29+ className = { cn (
30+ 'border-bds-gray-10 focus-visible:ring-base-blue/30 inline-flex items-center rounded-full border bg-white/80 outline-none transition-colors focus-visible:ring-2 dark:border-white/10 dark:bg-white/10' ,
31+ size === 'sm' ? 'gap-1 px-2 py-1' : 'gap-1.5 px-2.5 py-1.5' ,
32+ ) }
33+ >
34+ { entries . map ( ( entry ) => (
35+ < span key = { entry . networkKey } className = "inline-flex items-center gap-1" >
36+ < span
37+ className = { cn (
38+ 'rounded-full ring-2 ring-black/5 dark:ring-white/10' ,
39+ size === 'sm' ? 'h-2 w-2' : 'h-2.5 w-2.5' ,
40+ entry . dotClassName ,
41+ ) }
42+ />
43+ { showLabels ? (
44+ < span className = "font-mono text-[11px] font-medium uppercase leading-[14px] tracking-[0px] text-[#787878] md:text-[12px] md:leading-[16px]" >
45+ { entry . networkKey . slice ( 0 , 1 ) }
46+ </ span >
47+ ) : null }
48+ </ span >
49+ ) ) }
5350 </ Tooltip . Trigger >
5451 < Tooltip . Portal >
55- < Tooltip . Content
52+ < Tooltip . Positioner
5653 side = "top"
5754 align = "center"
58- sideOffset = { 8 }
55+ sideOffset = { 14 }
5956 collisionPadding = { 16 }
60- className = "border-bds-gray-10 pointer-events-none z-[12000] w-max max-w-[min(20rem,calc(100vw-2rem))] rounded-lg border bg-background px-3 py-2 shadow-lg dark:border-white/10 "
57+ className = "z-[12000]"
6158 >
62- < span className = "block space-y-1" >
63- { entries . map ( ( entry ) => (
64- < span key = { entry . network } className = "flex items-baseline justify-between gap-4" >
65- < span className = "text-[11px] font-medium leading-[14px] tracking-[0px] text-foreground md:text-[12px] md:leading-[16px] dark:text-white" >
66- { entry . network }
59+ < Tooltip . Popup className = "pointer-events-none w-max max-w-[min(20rem,calc(100vw-2rem))] origin-[var(--transform-origin)] rounded-lg bg-background px-3 py-2 shadow-lg outline-none ring-1 ring-black/[0.04] will-change-transform transition-[opacity,transform] duration-150 ease-out data-[ending-style]:opacity-0 data-[ending-style]:[transform:scale(0.97)] data-[instant]:transition-none data-[starting-style]:opacity-0 data-[starting-style]:[transform:scale(0.97)] dark:bg-[#1a1a1a] dark:ring-inset dark:ring-[color-mix(in_srgb,#1a1a1a,white_8%)] motion-reduce:transition-none" >
60+ < span className = "block space-y-1" >
61+ { entries . map ( ( entry ) => (
62+ < span key = { entry . network } className = "flex items-baseline justify-between gap-4" >
63+ < span className = "text-[11px] font-medium leading-[14px] tracking-[0px] text-foreground md:text-[12px] md:leading-[16px] dark:text-white" >
64+ { entry . network }
65+ </ span >
66+ < span className = "text-right font-mono text-[11px] font-medium leading-[14px] tracking-[0px] text-[#787878] md:text-[12px] md:leading-[16px]" >
67+ { entry . state }
68+ { entry . date ? ` · ${ entry . date } ` : '' }
69+ </ span >
6770 </ span >
68- < span className = "text-right font-mono text-[11px] font-medium leading-[14px] tracking-[0px] text-[#787878] md:text-[12px] md:leading-[16px]" >
69- { entry . state }
70- { entry . date ? ` · ${ entry . date } ` : '' }
71- </ span >
72- </ span >
73- ) ) }
74- </ span >
75- < Tooltip . Arrow width = { 10 } height = { 5 } className = "fill-background" />
76- </ Tooltip . Content >
71+ ) ) }
72+ </ span >
73+ < Tooltip . Arrow className = "group flex will-change-transform data-[side=bottom]:top-[-7px] data-[side=left]:right-[-11px] data-[side=right]:left-[-11px] data-[side=top]:bottom-[-7px]" >
74+ < svg
75+ width = "16"
76+ height = "8"
77+ viewBox = "0 0 16 8"
78+ aria-hidden = "true"
79+ className = "block origin-center fill-background stroke-black/[0.04] group-data-[side=bottom]:rotate-180 group-data-[side=left]:-rotate-90 group-data-[side=right]:rotate-90 dark:fill-[#1a1a1a] dark:stroke-[color-mix(in_srgb,#1a1a1a,white_8%)]"
80+ >
81+ < path d = "M0 0 L6.2 6 Q8 8 9.8 6 L16 0" strokeWidth = "1" strokeLinejoin = "round" />
82+ </ svg >
83+ </ Tooltip . Arrow >
84+ </ Tooltip . Popup >
85+ </ Tooltip . Positioner >
7786 </ Tooltip . Portal >
7887 </ Tooltip . Root >
7988 </ Tooltip . Provider >
0 commit comments