Replace incorrect perceived-brightness formula in Stats progress bars with proper WCAG relative luminance calculation, and convert type bar colors to hex values for reliable contrast detection. Add light: variant classes to status badges, yellow/purple text, and admin nav links across 17 files. Darken light-mode status-active token and text-tertiary/muted tokens. Add aria-labels to admin filter selects and flex-wrap for mobile overflow on AdminEvolutions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { PokemonCard } from './PokemonCard'
|
|
import type { EncounterDetail } from '../types'
|
|
|
|
interface ShinyBoxProps {
|
|
encounters: EncounterDetail[]
|
|
onEncounterClick?: ((encounter: EncounterDetail) => void) | undefined
|
|
}
|
|
|
|
export function ShinyBox({ encounters, onEncounterClick }: ShinyBoxProps) {
|
|
return (
|
|
<div className="border-2 border-yellow-600 rounded-lg p-4">
|
|
<h3 className="text-sm font-semibold text-yellow-400 light:text-amber-700 mb-3 flex items-center gap-1.5">
|
|
<span>✦</span>
|
|
Shiny Box
|
|
<span className="text-xs font-normal text-text-muted ml-1">
|
|
{encounters.length} {encounters.length === 1 ? 'shiny' : 'shinies'}
|
|
</span>
|
|
</h3>
|
|
{encounters.length > 0 ? (
|
|
<div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-2">
|
|
{encounters.map((enc) => (
|
|
<PokemonCard
|
|
key={enc.id}
|
|
encounter={enc}
|
|
onClick={onEncounterClick ? () => onEncounterClick(enc) : undefined}
|
|
/>
|
|
))}
|
|
</div>
|
|
) : (
|
|
<p className="text-sm text-text-muted text-center py-2">No shinies found yet</p>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|