import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { PixelTabs, PixelAccordion, PixelBreadcrumb, PixelPagination } from './navigation';
import type { TabItem, AccordionItem } from './common';
import { PxlKitIcon } from '@pxlkit/core';
import { Trophy } from '@pxlkit/gamification';
import { Heart } from '@pxlkit/social';
import { Sun } from '@pxlkit/weather';
const SURFACES = ['pixel', 'linear'] as const;
const TABS: TabItem[] = [
{ id: 'overview', label: 'Overview', icon: , content:
Pxlkit ships 54 retro pixel-art React components plus 226+ SVG icons across 7 themed packs.
},
{ id: 'usage', label: 'Usage', icon: , content: Import any component from @pxlkit/ui-kit and add the styles.
},
{ id: 'api', label: 'API', icon: , content: Every component accepts a surface and tone prop.
},
{ id: 'changelog', label: 'Changelog', content: See CHANGELOG.md for the full history.
},
];
const ACCORDION: AccordionItem[] = [
{ id: 'install', title: 'Installation', content: Run npm install @pxlkit/ui-kit and import the styles.
},
{ id: 'theme', title: 'Theming', content: Override any --retro-* CSS variable on :root or .dark to reskin every component at once.
},
{ id: 'a11y', title: 'Accessibility', content: Every component ships with proper ARIA roles and keyboard navigation.
},
];
const meta: Meta = {
title: 'UI Kit / Navigation',
parameters: { layout: 'padded' },
};
export default meta;
type Story = StoryObj;
export const AllNavigation: Story = {
render: (args: any) => {
const [page, setPage] = useState(3);
return (
);
},
argTypes: { surface: { control: 'inline-radio', options: SURFACES } },
args: { surface: 'pixel' as const },
};
/* ──────────────────────────────────────────────────────────────────────────
PixelTabs
────────────────────────────────────────────────────────────────────────── */
export const PixelTabsStory: Story = {
name: 'PixelTabs',
render: (args: any) => ,
argTypes: {
surface: { control: 'inline-radio', options: SURFACES },
defaultTab: { control: 'select', options: TABS.map((t) => t.id) },
},
args: { items: TABS, defaultTab: 'overview', surface: 'pixel' },
};
/* ──────────────────────────────────────────────────────────────────────────
PixelAccordion
────────────────────────────────────────────────────────────────────────── */
export const PixelAccordionStory: Story = {
name: 'PixelAccordion',
render: (args: any) => ,
argTypes: {
allowMultiple: { control: 'boolean' },
surface: { control: 'inline-radio', options: SURFACES },
},
args: { items: ACCORDION, allowMultiple: false, surface: 'pixel' },
};
/* ──────────────────────────────────────────────────────────────────────────
PixelBreadcrumb
────────────────────────────────────────────────────────────────────────── */
export const PixelBreadcrumbStory: Story = {
name: 'PixelBreadcrumb',
render: (args: any) => ,
argTypes: {
surface: { control: 'inline-radio', options: SURFACES },
},
args: {
surface: 'pixel',
items: [
{ label: 'Pxlkit', href: '/' },
{ label: 'UI Kit', href: '/ui-kit' },
{ label: 'Navigation', active: true },
],
},
};
/* ──────────────────────────────────────────────────────────────────────────
PixelPagination
────────────────────────────────────────────────────────────────────────── */
export const PixelPaginationStory: Story = {
name: 'PixelPagination',
render: (args: any) => {
const [p, setP] = useState(args.page as number ?? 3);
return ;
},
argTypes: {
page: { control: { type: 'number', min: 1 } },
total: { control: { type: 'number', min: 1 } },
surface: { control: 'inline-radio', options: SURFACES },
},
args: { page: 3, total: 8, surface: 'pixel' },
};