import type { Meta, StoryObj } from '@storybook/react'; import { PixelAlert, PixelProgress, PixelSkeleton, PixelEmptyState } from './feedback'; import { PixelButton } from './actions'; import { PxlKitIcon, AnimatedPxlKitIcon } from '@pxlkit/core'; import { CheckCircle, WarningTriangle, InfoCircle, Bell, ErrorOctagon } from '@pxlkit/feedback'; import { Trophy, FireSword } from '@pxlkit/gamification'; const TONES = ['green', 'cyan', 'gold', 'red', 'purple', 'pink', 'neutral'] as const; const SURFACES = ['pixel', 'linear'] as const; const meta: Meta = { title: 'UI Kit / Feedback', parameters: { layout: 'padded' }, }; export default meta; type Story = StoryObj; /** Overview — every feedback component side by side, every tone. */ export const AllFeedback: Story = { render: (args: any) => (

PixelAlert — every tone

} surface={args.surface} /> } surface={args.surface} /> } surface={args.surface} /> } action={Use potion} surface={args.surface} /> } surface={args.surface} />

PixelProgress — pixel segmented HP-bar

PixelSkeleton

PixelEmptyState

} action={Open builder} surface={args.surface} />
), argTypes: { surface: { control: 'inline-radio', options: SURFACES }, }, args: { surface: 'pixel' as const }, }; /* ────────────────────────────────────────────────────────────────────────── PixelAlert ────────────────────────────────────────────────────────────────────────── */ export const PixelAlertStory: Story = { name: 'PixelAlert', render: (args: any) => , argTypes: { title: { control: 'text' }, message: { control: 'text' }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { title: 'QUEST COMPLETE', message: 'Boss defeated. +500 XP awarded.', tone: 'green', surface: 'pixel', icon: , }, }; /* ────────────────────────────────────────────────────────────────────────── PixelProgress ────────────────────────────────────────────────────────────────────────── */ export const PixelProgressStory: Story = { name: 'PixelProgress', render: (args: any) =>
, argTypes: { value: { control: { type: 'range', min: 0, max: 100 } }, label: { control: 'text' }, showValue: { control: 'boolean' }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { value: 68, label: 'HP', showValue: true, tone: 'green', surface: 'pixel', }, }; /* ────────────────────────────────────────────────────────────────────────── PixelSkeleton ────────────────────────────────────────────────────────────────────────── */ export const PixelSkeletonStory: Story = { name: 'PixelSkeleton', render: (args: any) => (
), argTypes: { width: { control: 'text' }, height: { control: 'text' }, rounded: { control: 'boolean' }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { width: '60%', height: '1rem', rounded: false, surface: 'pixel', }, }; /* ────────────────────────────────────────────────────────────────────────── PixelEmptyState ────────────────────────────────────────────────────────────────────────── */ export const PixelEmptyStateStory: Story = { name: 'PixelEmptyState', render: (args: any) => , argTypes: { title: { control: 'text' }, description: { control: 'text' }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { title: 'No icons in your inventory', description: 'Open the visual builder or browse one of the 7 packs to start collecting.', surface: 'pixel', icon: , action: Open builder, }, };