- Add root biome.json that extends packages/config/biome.json - Add explicit ignore patterns for dist/, build/, .next/, .turbo/, etc. - Make a11y lints warnings instead of errors (non-blocking) - Remove invalid biome-ignore comment from Section.tsx - Apply formatting to all source files (155 files checked, 129 fixed) This fixes the CI format check that was failing with 2064+ errors because Biome was checking generated files in dist/ and .turbo/. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
94 lines
2.5 KiB
TypeScript
94 lines
2.5 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react';
|
|
import { Input } from '@tpmjs/ui/Input/Input';
|
|
import { Label } from '@tpmjs/ui/Label/Label';
|
|
import { createElement } from 'react';
|
|
|
|
const meta = {
|
|
title: 'Components/Input',
|
|
component: Input,
|
|
tags: ['autodocs'],
|
|
parameters: {
|
|
layout: 'centered',
|
|
},
|
|
} satisfies Meta<typeof Input>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Default: Story = {
|
|
render: () => createElement(Input, { placeholder: 'Enter text...' }),
|
|
};
|
|
|
|
export const WithLabel: Story = {
|
|
render: () =>
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-2 w-80' },
|
|
createElement(Label, { htmlFor: 'email' }, 'Email address'),
|
|
createElement(Input, {
|
|
id: 'email',
|
|
type: 'email',
|
|
placeholder: 'name@example.com',
|
|
})
|
|
),
|
|
};
|
|
|
|
export const AllStates: Story = {
|
|
render: () =>
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-4 w-80' },
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-2' },
|
|
createElement(Label, {}, 'Normal'),
|
|
createElement(Input, { placeholder: 'Normal state' })
|
|
),
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-2' },
|
|
createElement(Label, {}, 'Success'),
|
|
createElement(Input, {
|
|
placeholder: 'Success state',
|
|
state: 'success',
|
|
})
|
|
),
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-2' },
|
|
createElement(Label, {}, 'Error'),
|
|
createElement(Input, { placeholder: 'Error state', state: 'error' })
|
|
),
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-2' },
|
|
createElement(Label, {}, 'Disabled'),
|
|
createElement(Input, { placeholder: 'Disabled state', disabled: true })
|
|
)
|
|
),
|
|
};
|
|
|
|
export const AllSizes: Story = {
|
|
render: () =>
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-4 w-80' },
|
|
createElement(Input, { size: 'sm', placeholder: 'Small size' }),
|
|
createElement(Input, { size: 'md', placeholder: 'Medium size' }),
|
|
createElement(Input, { size: 'lg', placeholder: 'Large size' })
|
|
),
|
|
};
|
|
|
|
export const PasswordInput: Story = {
|
|
render: () =>
|
|
createElement(
|
|
'div',
|
|
{ className: 'flex flex-col gap-2 w-80' },
|
|
createElement(Label, { htmlFor: 'password' }, 'Password'),
|
|
createElement(Input, {
|
|
id: 'password',
|
|
type: 'password',
|
|
placeholder: 'Enter password',
|
|
})
|
|
),
|
|
};
|