diff --git a/.storybook/main.ts b/.storybook/main.ts index 59e5042..88a5953 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,21 +1,37 @@ -import type { StorybookConfig } from "@storybook/nextjs"; +import type { StorybookConfig } from '@storybook/nextjs'; const config: StorybookConfig = { - stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], + stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], addons: [ - "@storybook/addon-onboarding", - "@storybook/addon-links", - "@storybook/addon-essentials", - "@chromatic-com/storybook", - "@storybook/addon-interactions", + '@storybook/addon-onboarding', + '@storybook/addon-links', + '@storybook/addon-essentials', + '@chromatic-com/storybook', + '@storybook/addon-interactions', + { + name: '@storybook/addon-postcss', + options: { + cssLoaderOptions: { + // When you have splitted your css over multiple files + // and use @import('./other-styles.css') + importLoaders: 1, + }, + postcssLoaderOptions: { + // When using postCSS 8 + implementation: require('postcss'), + }, + }, + }, + '@storybook/addon-mdx-gfm' ], framework: { - name: "@storybook/nextjs", + name: '@storybook/nextjs', options: {}, }, docs: { - autodocs: "tag", + autodocs: 'tag', }, - staticDirs: ["..\\public"], + staticDirs: ['..\\public'], }; export default config; + diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 37914b1..2684847 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -1,4 +1,5 @@ -import type { Preview } from "@storybook/react"; +import type { Preview } from '@storybook/react'; +import '../src/app/globals.css'; const preview: Preview = { parameters: { @@ -12,3 +13,4 @@ const preview: Preview = { }; export default preview; + diff --git a/package.json b/package.json index 3b29e18..3957a4a 100644 --- a/package.json +++ b/package.json @@ -25,15 +25,17 @@ "tailwindcss-animate": "^1.0.7" }, "devDependencies": { - "@chromatic-com/storybook": "^1.2.22", - "@storybook/addon-essentials": "^8.0.0", - "@storybook/addon-interactions": "^8.0.0", - "@storybook/addon-links": "^8.0.0", - "@storybook/addon-onboarding": "^8.0.0", - "@storybook/blocks": "^8.0.0", - "@storybook/nextjs": "^8.0.0", - "@storybook/react": "^8.0.0", - "@storybook/test": "^8.0.0", + "@chromatic-com/storybook": "^1.2.23", + "@storybook/addon-essentials": "^8.0.2", + "@storybook/addon-interactions": "^8.0.2", + "@storybook/addon-links": "^8.0.2", + "@storybook/addon-mdx-gfm": "^8.0.2", + "@storybook/addon-onboarding": "^8.0.2", + "@storybook/addon-postcss": "^2.0.0", + "@storybook/blocks": "^8.0.2", + "@storybook/nextjs": "^8.0.2", + "@storybook/react": "^8.0.2", + "@storybook/test": "^8.0.2", "@tanstack/eslint-plugin-query": "^5.27.7", "@types/node": "^20", "@types/react": "^18", @@ -43,7 +45,7 @@ "eslint-config-next": "14.1.3", "eslint-plugin-storybook": "^0.8.0", "postcss": "^8", - "storybook": "^8.0.0", + "storybook": "^8.0.2", "tailwindcss": "^3.3.0", "typescript": "^5" } diff --git a/src/app/page.tsx b/src/app/page.tsx index eb7213c..a15aea9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,113 +1,10 @@ +import PinInput from "@/components/ui/input/PinInput"; import Image from "next/image"; export default function Home() { return (
-
-

- Get started by editing  - {/* src/app/page.tsx */} -

-
- - By{" "} - Vercel Logo - -
-
- -
- Next.js Logo -
- -
- -

- Docs{" "} - - -> - -

-

- Find in-depth information about Next.js features and API. -

-
- - -

- Learn{" "} - - -> - -

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

- Templates{" "} - - -> - -

-

- Explore starter templates for Next.js. -

-
- - -

- Deploy{" "} - - -> - -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

-
-
+
); } diff --git a/src/components/ui/input/PinInput.stories.ts b/src/components/ui/input/PinInput.stories.ts new file mode 100644 index 0000000..ad63c54 --- /dev/null +++ b/src/components/ui/input/PinInput.stories.ts @@ -0,0 +1,20 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import PinInput from './PinInput'; + +const meta = { + title: 'Example/PinInput', + component: PinInput, + parameters: { + // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout + layout: 'centered', + }, + tags: ['autodocs'], +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args +export const Primary: Story = { + args: {}, +}; diff --git a/src/components/ui/input/PinInput.tsx b/src/components/ui/input/PinInput.tsx new file mode 100644 index 0000000..4d1138f --- /dev/null +++ b/src/components/ui/input/PinInput.tsx @@ -0,0 +1,15 @@ +import React from 'react' + +const PinInput = () => { + return ( + + + + + + Button Text + + ) +} + +export default PinInput \ No newline at end of file diff --git a/src/stories/Button.stories.ts b/src/stories/Button.stories.ts index 455a9d8..7740377 100644 --- a/src/stories/Button.stories.ts +++ b/src/stories/Button.stories.ts @@ -50,3 +50,4 @@ export const Small: Story = { label: 'Button', }, }; +