@@ -267,64 +267,71 @@ const LinkIcon = memo(({ link }: { link: ResponseLink }) => {
267267 const isSelected = selectedLinkIds . includes ( link . id ) ;
268268
269269 return (
270- < button
271- type = "button"
272- role = "checkbox"
273- aria-checked = { isSelected }
274- data-checked = { isSelected }
275- onClick = { ( e ) => handleLinkSelection ( link . id , e ) }
276- className = { cn (
277- "group relative hidden shrink-0 items-center justify-center outline-none sm:flex" ,
278- isSelectMode && "flex" ,
279- ) }
280- >
281- { /* Link logo background circle */ }
282- < div className = "absolute inset-0 shrink-0 rounded-full border border-neutral-200 opacity-0 transition-opacity group-data-[variant=loose]/card-list:sm:opacity-100" >
283- < div className = "h-full w-full rounded-full border border-white bg-gradient-to-t from-neutral-100" />
284- </ div >
285- < div className = "relative transition-[padding,transform] group-hover:scale-90 group-data-[variant=loose]/card-list:sm:p-2" >
286- < div className = "hidden sm:block" >
287- { link . archived ? (
288- < BoxArchive
289- className = { cn (
290- "shrink-0 p-0.5 text-neutral-600 transition-[width,height]" ,
291- LOGO_SIZE_CLASS_NAME ,
292- ) }
293- />
294- ) : (
295- < LinkLogo
296- apexDomain = { getApexDomain ( link . url ) }
270+ < CardList . Card . Context . Consumer >
271+ { ( { hovered } ) => (
272+ < div className = "relative" >
273+ < button
274+ type = "button"
275+ role = "checkbox"
276+ aria-checked = { isSelected }
277+ data-checked = { isSelected }
278+ onClick = { ( e ) => handleLinkSelection ( link . id , e ) }
279+ className = { cn (
280+ "group relative hidden shrink-0 items-center justify-center outline-none sm:flex" ,
281+ isSelectMode && "flex" ,
282+ ) }
283+ >
284+ { /* Link logo background circle */ }
285+ < div className = "absolute inset-0 shrink-0 rounded-full border border-neutral-200 opacity-0 transition-opacity group-data-[variant=loose]/card-list:sm:opacity-100" >
286+ < div className = "h-full w-full rounded-full border border-white bg-gradient-to-t from-neutral-100" />
287+ </ div >
288+ < div className = "relative transition-[padding,transform] group-hover:scale-90 group-data-[variant=loose]/card-list:sm:p-2" >
289+ < div className = "hidden sm:block" >
290+ { link . archived ? (
291+ < BoxArchive
292+ className = { cn (
293+ "shrink-0 p-0.5 text-neutral-600 transition-[width,height]" ,
294+ LOGO_SIZE_CLASS_NAME ,
295+ ) }
296+ />
297+ ) : (
298+ < LinkLogo
299+ apexDomain = { getApexDomain ( link . url ) }
300+ className = { cn (
301+ "shrink-0 transition-[width,height]" ,
302+ LOGO_SIZE_CLASS_NAME ,
303+ ) }
304+ imageProps = { {
305+ loading : "lazy" ,
306+ } }
307+ />
308+ ) }
309+ </ div >
310+ < div className = "size-5 group-data-[variant=loose]/card-list:size-6 sm:hidden" />
311+ </ div >
312+ { /* Checkbox */ }
313+ < div
297314 className = { cn (
298- "shrink-0 transition-[width,height]" ,
299- LOGO_SIZE_CLASS_NAME ,
315+ "pointer-events-none absolute inset-0 flex items-center justify-center rounded-full border border-neutral-400 bg-white ring-0 ring-black/5" ,
316+ "opacity-100 max-sm:ring sm:opacity-0" ,
317+ "transition-all duration-150 group-hover:opacity-100 group-hover:ring group-focus-visible:opacity-100 group-focus-visible:ring" ,
318+ "group-data-[checked=true]:opacity-100" ,
319+ hovered && "sm:opacity-100 sm:ring" ,
300320 ) }
301- imageProps = { {
302- loading : "lazy" ,
303- } }
304- />
305- ) }
306- </ div >
307- < div className = "size-5 group-data-[variant=loose]/card-list:size-6 sm:hidden" />
308- </ div >
309- { /* Checkbox */ }
310- < div
311- className = { cn (
312- "pointer-events-none absolute inset-0 flex items-center justify-center rounded-full border border-neutral-400 bg-white ring-0 ring-black/5" ,
313- "opacity-100 max-sm:ring sm:opacity-0" ,
314- "transition-all duration-150 group-hover:opacity-100 group-hover:ring group-focus-visible:opacity-100 group-focus-visible:ring" ,
315- "group-data-[checked=true]:opacity-100" ,
316- ) }
317- >
318- < div
319- className = { cn (
320- "rounded-full bg-neutral-800 p-0.5 group-data-[variant=loose]/card-list:p-1" ,
321- "scale-90 opacity-0 transition-[transform,opacity] duration-100 group-data-[checked=true]:scale-100 group-data-[checked=true]:opacity-100" ,
322- ) }
323- >
324- < Check2 className = "size-3 text-white" />
321+ >
322+ < div
323+ className = { cn (
324+ "rounded-full bg-neutral-800 p-0.5 group-data-[variant=loose]/card-list:p-1" ,
325+ "scale-90 opacity-0 transition-[transform,opacity] duration-100 group-data-[checked=true]:scale-100 group-data-[checked=true]:opacity-100" ,
326+ ) }
327+ >
328+ < Check2 className = "size-3 text-white" />
329+ </ div >
330+ </ div >
331+ </ button >
325332 </ div >
326- </ div >
327- </ button >
333+ ) }
334+ </ CardList . Card . Context . Consumer >
328335 ) ;
329336} ) ;
330337
0 commit comments