add eslint / prettier
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-23 14:19:16 +01:00
parent 01b00b5717
commit c2e370f0a8
34 changed files with 1305 additions and 470 deletions

View File

@@ -10,43 +10,44 @@ const meta = {
layout: 'padded',
docs: {
description: {
component: 'Sidebar navigation link with active state styling and collapsed/expanded rendering mode.'
}
}
component:
'Sidebar navigation link with active state styling and collapsed/expanded rendering mode.',
},
},
},
argTypes: {
to: {
description: 'Destination route path.',
control: 'text',
table: { type: { summary: 'string' } }
table: { type: { summary: 'string' } },
},
label: {
description: 'Navigation item label.',
control: 'text',
table: { type: { summary: 'string' } }
table: { type: { summary: 'string' } },
},
icon: {
description: 'Icon component rendered before the label.',
control: false,
table: { type: { summary: 'ComponentType<SVGProps<SVGSVGElement>>' } }
table: { type: { summary: 'ComponentType<SVGProps<SVGSVGElement>>' } },
},
collapsed: {
description: 'Collapsed state. When true, desktop view shows icon-only rail style.',
control: 'boolean',
table: { type: { summary: 'boolean' } }
table: { type: { summary: 'boolean' } },
},
onClick: {
description: 'Optional click callback (for example to close mobile drawer).',
action: 'clicked',
table: { type: { summary: '() => void' } }
}
table: { type: { summary: '() => void' } },
},
},
args: {
to: '/',
label: 'Dashboard',
icon: HomeIcon,
collapsed: false
}
collapsed: false,
},
} satisfies Meta<typeof SidebarNavItem>;
export default meta;
@@ -57,14 +58,19 @@ export const Expanded: Story = {
<nav className="flex w-56 flex-col gap-1">
<SidebarNavItem {...args} />
<SidebarNavItem to="/users" label="Users" icon={UsersIcon} collapsed={args.collapsed} />
<SidebarNavItem to="/profile" label="Profile" icon={UserCircleIcon} collapsed={args.collapsed} />
<SidebarNavItem
to="/profile"
label="Profile"
icon={UserCircleIcon}
collapsed={args.collapsed}
/>
</nav>
)
),
};
export const Collapsed: Story = {
args: {
collapsed: true
collapsed: true,
},
render: (args) => (
<nav className="flex w-14 flex-col gap-1">
@@ -72,5 +78,5 @@ export const Collapsed: Story = {
<SidebarNavItem to="/users" label="Users" icon={UsersIcon} collapsed />
<SidebarNavItem to="/profile" label="Profile" icon={UserCircleIcon} collapsed />
</nav>
)
),
};