import type { Meta, StoryObj } from '@storybook/react'; import { PixelCard } from './cards/PixelCard'; import { PixelStatCard } from './cards/PixelStatCard'; import { PixelTable } from './data/PixelTable'; import { PixelAvatar } from './data/PixelAvatar'; import { PixelBadge } from './data/PixelBadge'; import { PixelChip } from './data/PixelChip'; import { PixelTextLink } from './data/PixelTextLink'; import { PixelCollapsible } from './data/PixelCollapsible'; import { PixelCodeInline } from './data/PixelCodeInline'; import { PixelKbd } from './data/PixelKbd'; import { PixelColorSwatch } from './data/PixelColorSwatch'; import { PixelBareButton } from './actions/PixelBareButton'; import { PixelBareInput } from './forms/PixelBareInput'; import { PixelBareTextarea } from './forms/PixelBareTextarea'; import { PxlKitIcon, AnimatedPxlKitIcon } from '@pxlkit/core'; import { Trophy, Crown, Star, FireSword } from '@pxlkit/gamification'; import { Heart } from '@pxlkit/social'; const TONES = ['green', 'cyan', 'gold', 'red', 'purple', 'pink', 'neutral'] as const; const SIZES = ['sm', 'md', 'lg'] as const; const SURFACES = ['pixel', 'linear'] as const; const COLS = [ { key: 'pack', header: 'Pack', className: 'w-1/3' }, { key: 'icons', header: 'Icons' }, { key: 'status', header: 'Status' }, ]; const ROWS = [ { pack: 'gamification', icons: '51', status: stable }, { pack: 'feedback', icons: '33', status: stable }, { pack: 'social', icons: '43', status: stable }, { pack: 'parallax', icons: '10', status: 3D }, { pack: 'voxel', icons: '1', status: v0.1.x }, ]; const meta: Meta = { title: 'UI Kit / Data Display', parameters: { layout: 'padded' }, }; export default meta; type Story = StoryObj; /** Overview — every display component in one frame. */ export const AllDataDisplay: Story = { render: (args: any) => (
} tone="green" trend="+12 this release" surface={args.surface} /> } tone="gold" surface={args.surface} /> } tone="purple" trend="24 sections + 5 pages" surface={args.surface} />
} surface={args.surface} footer={Read more →}> A container with title, icon, body, and optional footer. } surface={args.surface}>
{}} surface={args.surface} />

PixelTable

{TONES.map((t) => {t})}
), argTypes: { surface: { control: 'inline-radio', options: SURFACES } }, args: { surface: 'pixel' as const }, }; /* Individual stories per component */ export const PixelCardStory: Story = { name: 'PixelCard', render: (args: any) => ( Read more →}> {args.children as React.ReactNode} ), argTypes: { title: { control: 'text' }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { title: 'Inventory', surface: 'pixel', icon: , children: 'A container with title, icon, body, and optional footer.', }, }; export const PixelStatCardStory: Story = { name: 'PixelStatCard', render: (args: any) =>
, argTypes: { label: { control: 'text' }, value: { control: 'text' }, trend: { control: 'text' }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { label: 'Components', value: '54', trend: '+12 this release', tone: 'green', surface: 'pixel', icon: , }, }; export const PixelTableStory: Story = { name: 'PixelTable', render: (args: any) => , argTypes: { striped: { control: 'boolean' }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { columns: COLS, data: ROWS, striped: true, surface: 'pixel' }, }; export const PixelAvatarStory: Story = { name: 'PixelAvatar', render: (args: any) => , argTypes: { name: { control: 'text' }, src: { control: 'text' }, size: { control: 'inline-radio', options: SIZES }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { name: 'Joangel De La Rosa', size: 'md', tone: 'green', surface: 'pixel' }, }; export const PixelBadgeStory: Story = { name: 'PixelBadge', render: (args: any) => {args.children as React.ReactNode}, argTypes: { tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, children: { control: 'text' }, }, args: { tone: 'green', surface: 'pixel', children: 'stable' }, }; export const PixelChipStory: Story = { name: 'PixelChip', render: (args: any) => console.log('remove')} />, argTypes: { label: { control: 'text' }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { label: 'React', tone: 'cyan', surface: 'pixel' }, }; export const PixelTextLinkStory: Story = { name: 'PixelTextLink', render: (args: any) => {args.children as React.ReactNode}, argTypes: { href: { control: 'text' }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, children: { control: 'text' }, }, args: { href: 'https://pxlkit.xyz', tone: 'cyan', surface: 'pixel', children: 'Browse all icons →' }, }; export const PixelCollapsibleStory: Story = { name: 'PixelCollapsible', render: (args: any) => (

{args.children as React.ReactNode}

), argTypes: { label: { control: 'text' }, defaultOpen: { control: 'boolean' }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, children: { control: 'text' }, }, args: { label: 'Show advanced settings', defaultOpen: false, tone: 'cyan', surface: 'pixel', children: 'Advanced settings would live here.', }, }; export const PixelCodeInlineStory: Story = { name: 'PixelCodeInline', render: (args: any) => (

Run {args.children as React.ReactNode} to install.

), argTypes: { tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, children: { control: 'text' }, }, args: { tone: 'cyan', surface: 'pixel', children: 'npm install @pxlkit/ui-kit' }, }; export const PixelKbdStory: Story = { name: 'PixelKbd', render: (args: any) => (

Press + K to open the command palette.

), argTypes: { surface: { control: 'inline-radio', options: SURFACES }, }, args: { surface: 'pixel' }, }; export const PixelColorSwatchStory: Story = { name: 'PixelColorSwatch', render: (args: any) => (
), argTypes: { surface: { control: 'inline-radio', options: SURFACES } }, args: { surface: 'pixel' as const }, }; /* Bare primitives — pass-through, no styling */ export const PixelBareButtonStory: Story = { name: 'PixelBareButton', render: (args: any) => {(args as { children?: React.ReactNode }).children ?? 'Bare button'}, args: { children: 'PixelBareButton — minimal click target' }, }; export const PixelBareInputStory: Story = { name: 'PixelBareInput', render: (args: any) => , args: { placeholder: 'PixelBareInput — no shell, just the input' }, }; export const PixelBareTextareaStory: Story = { name: 'PixelBareTextarea', render: (args: any) => , args: { placeholder: 'PixelBareTextarea — for low-chrome contexts', rows: 3 }, };