File tree Expand file tree Collapse file tree
src/lib/holocene/pill-container Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import type { HTMLButtonAttributes } from ' svelte/elements' ;
3- import { derived } from ' svelte/store' ; // ✅ ADD THIS
43
54 import { getContext , type Snippet } from ' svelte' ;
65 import { twMerge as merge } from ' tailwind-merge' ;
4140
4241 registerPill (id , disabled );
4342
44- const isActive = derived (activePill , ($activePill ) =>
45- isNull (active ) ? $activePill === id : active ,
46- );
43+ let isActive = $derived (isNull (active ) ? $activePill === id : active );
4744
4845 const handleClick = () => {
4946 if (disabled ) return ;
6057 class ={merge (
6158 ' surface-subtle flex items-center justify-center gap-2 rounded-full px-3 py-1 text-sm' ,
6259 ' focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/70' ,
63- $ isActive ? ' bg-interactive text-white' : ' ' ,
60+ isActive && ' bg-interactive text-white' ,
6461 className ,
6562 )}
6663 {disabled }
You can’t perform that action at this time.
0 commit comments