diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml
new file mode 100644
index 00000000..1d3cfed0
--- /dev/null
+++ b/.github/workflows/chromatic.yml
@@ -0,0 +1,42 @@
+name: 'Chromatic Deployment'
+
+on:
+ pull_request:
+ branches:
+ - develop
+
+permissions: write-all
+
+jobs:
+ chromatic:
+ name: 'Run Chromatic'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Install Dependencies
+ run: yarn
+
+ - name: Run Chromatic
+ id: chromatic
+ uses: chromaui/action@latest
+ with:
+ projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
+ token: ${{ secrets.GITHUB_TOKEN }}
+ onlyChanged: true
+ autoAcceptChanges: true
+
+ - name: Create comment PR
+ uses: thollander/actions-comment-pull-request@v2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
+ with:
+ comment_tag: ${{ github.event.pull_request.number }}-storybook
+ message: |
+ πͺ· Storybook νμΈ πͺ·
+ π ${{ steps.chromatic.outputs.storybookUrl }}
+ edit_mode: update
diff --git a/.gitignore b/.gitignore
index f940a995..93c98991 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,4 @@ dist-ssr
*.sw?
*storybook.log
+.env
diff --git a/.storybook/main.ts b/.storybook/main.ts
index 768eb03e..ba187032 100644
--- a/.storybook/main.ts
+++ b/.storybook/main.ts
@@ -1,15 +1,16 @@
-import type { StorybookConfig } from "@storybook/react-vite";
+import type { StorybookConfig } from '@storybook/react-vite';
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-essentials",
- "@chromatic-com/storybook",
- "@storybook/addon-interactions",
+ '@storybook/addon-onboarding',
+ '@storybook/addon-essentials',
+ '@chromatic-com/storybook',
+ '@storybook/addon-interactions',
+ 'storybook-addon-react-router-v6',
],
framework: {
- name: "@storybook/react-vite",
+ name: '@storybook/react-vite',
options: {},
},
};
diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html
new file mode 100644
index 00000000..82ee1ca8
--- /dev/null
+++ b/.storybook/preview-head.html
@@ -0,0 +1,3 @@
+
diff --git a/.storybook/preview.ts b/.storybook/preview.ts
deleted file mode 100644
index 37914b18..00000000
--- a/.storybook/preview.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import type { Preview } from "@storybook/react";
-
-const preview: Preview = {
- parameters: {
- controls: {
- matchers: {
- color: /(background|color)$/i,
- date: /Date$/i,
- },
- },
- },
-};
-
-export default preview;
diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx
new file mode 100644
index 00000000..d70c025d
--- /dev/null
+++ b/.storybook/preview.tsx
@@ -0,0 +1,38 @@
+import type { Preview } from '@storybook/react';
+import React from 'react';
+import { withRouter } from 'storybook-addon-react-router-v6';
+import '../src/styles/fonts.css';
+import '../src/styles/global.css';
+import '../src/styles/reset.css';
+
+const preview: Preview = {
+ parameters: {
+ actions: { argTypesRegex: '^on[A-Z].*' },
+ controls: {
+ matchers: {
+ color: /(background|color)$/i,
+ date: /Date$/i,
+ },
+ reactRouter: {
+ routePath: '/',
+ },
+ },
+ },
+ decorators: [
+ (Story) => (
+ <>
+
+