brackt/app/components/league/StandingsPreview.stories.tsx
Chris Parsons d744e0d858 Add StandingsPreview card component with podium row styling
- New StandingsPreview component with gold/silver/bronze row tints for
  top 3, team avatar, and LeagueRow-style stat columns (Ranking + Points)
  with rank and 7-day point change indicators
- Fix GradientIcon in Storybook by adding BracktGradients decorator to
  preview.tsx (renamed from .ts to support JSX)
- Fix degenerate SVG gradient on horizontal strokes by switching
  BracktGradients to gradientUnits="userSpaceOnUse" with Lucide-space
  coordinates (0→24)
- Revert erroneous fill: url(#gradient) from GradientIcon; stroke-only
  fix was sufficient once gradientUnits was corrected

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 19:50:39 -07:00

265 lines
5.9 KiB
TypeScript

import type { Meta, StoryObj } from "@storybook/react-vite";
import { StandingsPreview } from "./StandingsPreview";
const meta: Meta<typeof StandingsPreview> = {
title: "League/StandingsPreview",
component: StandingsPreview,
parameters: {
layout: "padded",
},
};
export default meta;
type Story = StoryObj<typeof StandingsPreview>;
export const TopThreePodium: Story = {
args: {
entries: [
{
teamId: "t1",
teamName: "Lightning Wolves",
ownerName: "alice",
displayRank: 1,
currentRank: 1,
points: 2810,
href: "/leagues/1/standings/1/teams/t1",
},
{
teamId: "t2",
teamName: "Shadow Hawks",
ownerName: "bob",
displayRank: 2,
currentRank: 2,
points: 2654.5,
href: "/leagues/1/standings/1/teams/t2",
},
{
teamId: "t3",
teamName: "Iron Eagles",
ownerName: "carol",
displayRank: 3,
currentRank: 3,
points: 2493,
href: "/leagues/1/standings/1/teams/t3",
},
],
},
};
export const FullLeague: Story = {
args: {
entries: [
{
teamId: "t1",
teamName: "Lightning Wolves",
ownerName: "alice",
displayRank: 1,
currentRank: 1,
points: 2810,
rankChange: 2,
pointChange: 87.5,
href: "/leagues/1/standings/1/teams/t1",
},
{
teamId: "t2",
teamName: "Shadow Hawks",
ownerName: "bob",
displayRank: 2,
currentRank: 2,
points: 2654.5,
rankChange: 0,
pointChange: 42.0,
href: "/leagues/1/standings/1/teams/t2",
},
{
teamId: "t3",
teamName: "Iron Eagles",
ownerName: "carol",
displayRank: 3,
currentRank: 3,
points: 2493,
rankChange: -1,
pointChange: -12.3,
href: "/leagues/1/standings/1/teams/t3",
},
{
teamId: "t4",
teamName: "Cyber Foxes",
ownerName: "dave",
displayRank: 4,
currentRank: 4,
points: 2311.8,
rankChange: 1,
pointChange: 23.1,
href: "/leagues/1/standings/1/teams/t4",
},
{
teamId: "t5",
teamName: "Neon Tigers",
ownerName: "eve",
displayRank: 5,
currentRank: 5,
points: 2108,
rankChange: -2,
pointChange: -55.0,
href: "/leagues/1/standings/1/teams/t5",
},
{
teamId: "t6",
teamName: "Phantom Sharks",
ownerName: "frank",
displayRank: 6,
currentRank: 6,
points: 1987.3,
rankChange: 0,
pointChange: 0,
href: "/leagues/1/standings/1/teams/t6",
},
{
teamId: "t7",
teamName: "Crimson Tide FC",
ownerName: "grace",
displayRank: 7,
currentRank: 7,
points: 1834,
href: "/leagues/1/standings/1/teams/t7",
},
{
teamId: "t8",
teamName: "Arctic Wolves United",
ownerName: "hank",
displayRank: 8,
currentRank: 8,
points: 1692.6,
href: "/leagues/1/standings/1/teams/t8",
},
],
},
};
export const WithTies: Story = {
args: {
entries: [
{
teamId: "t1",
teamName: "Lightning Wolves",
ownerName: "alice",
displayRank: "T1",
currentRank: 1,
points: 2810,
href: "/leagues/1/standings/1/teams/t1",
},
{
teamId: "t2",
teamName: "Shadow Hawks",
ownerName: "bob",
displayRank: "T1",
currentRank: 1,
points: 2810,
href: "/leagues/1/standings/1/teams/t2",
},
{
teamId: "t3",
teamName: "Iron Eagles",
ownerName: "carol",
displayRank: "T3",
currentRank: 3,
points: 2493,
href: "/leagues/1/standings/1/teams/t3",
},
{
teamId: "t4",
teamName: "Cyber Foxes",
ownerName: "dave",
displayRank: "T3",
currentRank: 3,
points: 2493,
href: "/leagues/1/standings/1/teams/t4",
},
],
},
};
export const AllUnranked: Story = {
args: {
entries: [
{
teamId: "t1",
teamName: "Lightning Wolves",
ownerName: "alice",
displayRank: "T1",
points: 0,
href: "/leagues/1/standings/1/teams/t1",
},
{
teamId: "t2",
teamName: "Shadow Hawks",
ownerName: "bob",
displayRank: "T1",
points: 0,
href: "/leagues/1/standings/1/teams/t2",
},
{
teamId: "t3",
teamName: "Iron Eagles",
ownerName: "carol",
displayRank: "T1",
points: 0,
href: "/leagues/1/standings/1/teams/t3",
},
],
},
};
export const NoOwnerNames: Story = {
args: {
entries: [
{
teamId: "t1",
teamName: "Lightning Wolves",
displayRank: 1,
currentRank: 1,
points: 2810,
},
{
teamId: "t2",
teamName: "Shadow Hawks",
displayRank: 2,
currentRank: 2,
points: 2654.5,
},
{
teamId: "t3",
teamName: "Iron Eagles",
displayRank: 3,
currentRank: 3,
points: 2493,
},
],
},
};
export const LongTeamNames: Story = {
args: {
entries: [
{
teamId: "t1",
teamName: "The Unstoppable Championship Winning Lightning Wolves",
ownerName: "alice_with_a_really_long_username",
displayRank: 1,
currentRank: 1,
points: 2810,
href: "/leagues/1/standings/1/teams/t1",
},
{
teamId: "t2",
teamName: "Shadow Hawks of the Northern Division",
ownerName: "bob",
displayRank: 2,
currentRank: 2,
points: 2654.5,
href: "/leagues/1/standings/1/teams/t2",
},
],
},
};