feat: add initial TypeScript and ESLint configurations for library and React applications
- Created TypeScript configuration files for library and React applications. - Added ESLint configurations for library, React, and Storybook. - Implemented a basic Button component in the UI package. - Set up Vite for the docs development environment.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { Button } from '@repo/ui';
|
||||
|
||||
const meta: Meta<typeof Button> = {
|
||||
component: Button,
|
||||
argTypes: {
|
||||
type: {
|
||||
control: { type: 'radio' },
|
||||
options: ['button', 'submit', 'reset'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof Button>;
|
||||
|
||||
/*
|
||||
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
||||
* See https://storybook.js.org/docs/react/api/csf
|
||||
* to learn how to use render functions.
|
||||
*/
|
||||
export const Primary: Story = {
|
||||
render: (props) => (
|
||||
<Button
|
||||
{...props}
|
||||
onClick={(): void => {
|
||||
// eslint-disable-next-line no-alert -- alert for demo
|
||||
alert('Hello from Turborepo!');
|
||||
}}
|
||||
>
|
||||
Hello
|
||||
</Button>
|
||||
),
|
||||
name: 'Button',
|
||||
args: {
|
||||
children: 'Hello',
|
||||
type: 'button',
|
||||
style: {
|
||||
color: 'blue',
|
||||
border: '1px solid gray',
|
||||
padding: 10,
|
||||
borderRadius: 10,
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user