import type { Meta, StoryObj } from '@storybook/react'; import { PixelButton, PxlKitButton, PixelSplitButton } from './actions'; import { PxlKitIcon, AnimatedPxlKitIcon } from '@pxlkit/core'; import { Trophy, FireSword, Crown, Star } from '@pxlkit/gamification'; import { CheckCircle, Bell } from '@pxlkit/feedback'; 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 meta: Meta = { title: 'UI Kit / Actions', parameters: { layout: 'padded' }, }; export default meta; type Story = StoryObj; /** Overview — every action component side by side, every tone, every surface. */ export const AllActions: Story = { render: (args: any) => (

PixelButton — every tone

{TONES.map((t) => ( {t} ))}

Sizes & variants

Small Medium Large Ghost } surface={args.surface}>Trophy } tone="gold" surface={args.surface}>Crown Working Disabled

PxlKitButton — icon-only with animated icons

} size="sm" surface={args.surface} /> } size="md" tone="cyan" surface={args.surface} /> } size="lg" tone="gold" surface={args.surface} />

PixelSplitButton

console.log('Save primary')} onSelect={(v) => console.log('split select', v)} />
), argTypes: { surface: { control: 'inline-radio', options: SURFACES }, }, args: { surface: 'pixel' as const }, }; /* ────────────────────────────────────────────────────────────────────────── PixelButton — versatile action button with tone, size, variant, surface. ────────────────────────────────────────────────────────────────────────── */ export const PixelButtonStory: Story = { name: 'PixelButton', render: (args: any) => ( {args.children as React.ReactNode} ), argTypes: { tone: { control: 'select', options: TONES }, size: { control: 'inline-radio', options: SIZES }, variant: { control: 'inline-radio', options: ['solid', 'ghost'] }, surface: { control: 'inline-radio', options: SURFACES }, loading: { control: 'boolean' }, disabled: { control: 'boolean' }, children: { control: 'text' }, }, args: { tone: 'green', size: 'md', variant: 'solid', surface: 'pixel', loading: false, disabled: false, children: 'Start Quest', iconLeft: , }, }; /* ────────────────────────────────────────────────────────────────────────── PxlKitButton — icon-only square button with accessible label. ────────────────────────────────────────────────────────────────────────── */ export const PxlKitButtonStory: Story = { name: 'PxlKitButton', render: (args: any) => , argTypes: { label: { control: 'text' }, tone: { control: 'select', options: TONES }, size: { control: 'inline-radio', options: SIZES }, surface: { control: 'inline-radio', options: SURFACES }, disabled: { control: 'boolean' }, }, args: { label: 'Open quest log', tone: 'cyan', size: 'md', surface: 'pixel', disabled: false, icon: , }, }; /* ────────────────────────────────────────────────────────────────────────── PixelSplitButton — primary action + chevron dropdown for secondary options. ────────────────────────────────────────────────────────────────────────── */ export const PixelSplitButtonStory: Story = { name: 'PixelSplitButton', render: (args: any) => ( console.log('primary')} onSelect={(v) => console.log('select', v)} /> ), argTypes: { label: { control: 'text' }, tone: { control: 'select', options: TONES }, surface: { control: 'inline-radio', options: SURFACES }, disabled: { control: 'boolean' }, }, args: { label: 'Export', tone: 'purple', surface: 'pixel', disabled: false, options: [ { value: 'png', label: 'Export as PNG' }, { value: 'svg', label: 'Export as SVG' }, { value: 'json', label: 'Export icon code' }, ], }, };