Skip to content

Commit

Permalink
Merge pull request #3 from TEAM-ALOM/feature/storybook
Browse files Browse the repository at this point in the history
스토리북 세팅
  • Loading branch information
GHooN99 authored Oct 11, 2024
2 parents b25866b + 1d15fe6 commit a046474
Show file tree
Hide file tree
Showing 34 changed files with 4,402 additions and 289 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 스토리북 Github Pages 배포

on:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20.x'

- uses: bitovi/[email protected]
with:
install_command: npm install
build_command: npm run build-storybook
path: storybook-static
checkout: false
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

*storybook.log
storybook-static
17 changes: 17 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
'@storybook/addon-themes',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
};
export default config;
10 changes: 10 additions & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<title>Semo UI Components</title>
<meta property="og:title" content="Semo UI Components" />
<meta charset="UTF-8" />
<meta name="description" content="Semo UI Components" />
<meta property="og:title" content="Semo UI Components" />
<meta property="og:image" content="/images/mainLogo.png" />
<meta property="og:description" content="Semo 의 UI Components 문서입니다!" />
<meta property="og:site_name" content="Semo UI Components" />
<meta property="title" content="Semo UI Components" />
<meta property="description" content="Semo 의 UI Components 문서입니다!" />
29 changes: 29 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { addons } from '@storybook/manager-api';
import { themes } from '@storybook/theming';

addons.setConfig({
navSize: 300,
bottomPanelHeight: 300,
rightPanelWidth: 300,
panelPosition: 'bottom',
enableShortcuts: true,
showToolbar: true,
theme: {
...themes.light,
brandTitle: 'Semo UI Components ✨',
base: 'light',
},
selectedPanel: undefined,
initialActive: 'sidebar',
sidebar: {
showRoots: false,
collapsedRoots: ['other'],
},
toolbar: {
title: { hidden: false },
zoom: { hidden: false },
eject: { hidden: false },
copy: { hidden: false },
fullscreen: { hidden: false },
},
});
29 changes: 29 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { ThemeProvider } from 'styled-components';
import { withThemeFromJSXProvider } from '@storybook/addon-themes';
import type { Preview } from '@storybook/react';
import { SemoGlobalStyles } from '../src/ui/styles/SemoGlobalStyles';
import { theme } from '../src/ui/styles/theme';

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},

decorators: [
withThemeFromJSXProvider({
themes: {
light: theme,
},
defaultTheme: 'light',
Provider: ThemeProvider,
GlobalStyles: SemoGlobalStyles,
}),
],
};

export default preview;
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import tseslint from 'typescript-eslint';
import js from '@eslint/js';

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ['dist', 'storybook-static'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
Expand Down
Loading

0 comments on commit a046474

Please sign in to comment.