veza/apps/web/src/features/tracks/components/ViewToggle.stories.tsx
senke 9f40182ad1 ui(design): Phase 3 - rounded tokens, min-w/min-h, stories, NavigationProgress
- rounded-[var(--radius-xl/md/lg/sm)] → rounded-xl, rounded-md, rounded-lg, rounded-sm
- Timeline: min-w-[200px] → min-w-50
- AddEquipmentView, MetadataForm: min-h-[100px] → min-h-25
- NavigationProgress: shadow-[...] → shadow-button-primary-glow
- Stories: ActivityGraph, StatCard, NotificationBell, LoadingState, ScrollArea, Skeleton, FileUploadZone
- Reduced arbitrary values from ~60+ to 11 (5 files, exceptions documented)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-10 19:24:07 +01:00

64 lines
1.8 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/react';
import { ViewToggle } from './ViewToggle';
import { useArgs } from '@storybook/preview-api';
const meta = {
title: 'Components/Features/Tracks/ViewToggle',
component: ViewToggle,
tags: ['autodocs'],
parameters: { layout: 'centered' },
decorators: [
(Story) => (
<div className="p-4 bg-background border border-border rounded-xl min-h-layout-story">
<Story />
</div>
),
],
argTypes: {
onChange: { action: 'changed' },
value: {
control: 'radio',
options: ['list', 'grid']
}
},
} satisfies Meta<typeof ViewToggle>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
render: (args) => {
const [{ value }, updateArgs] = useArgs();
return <ViewToggle {...args} value={value} onChange={(newValue) => updateArgs({ value: newValue })} />;
},
args: {
value: 'list' as const,
showLabels: true,
onChange: () => { },
}
};
export const IconOnly: Story = {
render: (args) => {
const [{ value }, updateArgs] = useArgs();
return <ViewToggle {...args} value={value} onChange={(newValue) => updateArgs({ value: newValue })} />;
},
args: {
value: 'grid' as const,
showLabels: false,
onChange: () => { },
}
};
/** Both states to validate tokens and hover/active. */
export const VisualStressTest: Story = {
render: (args) => {
const [{ value }, updateArgs] = useArgs();
return <ViewToggle {...args} value={value} onChange={(newValue) => updateArgs({ value: newValue })} />;
},
args: {
value: 'list' as const,
showLabels: true,
onChange: () => { },
}
};