Skip to content

Commit

Permalink
Merge pull request #1 from jhancock532/storybook
Browse files Browse the repository at this point in the history
Add Storybook
  • Loading branch information
jhancock532 authored Jul 26, 2024
2 parents 9d154f5 + 194129d commit f306d9d
Show file tree
Hide file tree
Showing 20 changed files with 21,903 additions and 3,519 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/deploy-storybook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and Publish Storybook to GitHub Pages

on:
push:
branches:
- 'main'

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

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: bitovi/[email protected]
with:
install_command: npm ci
build_command: npm run build-storybook
path: storybook-static
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

*storybook.log
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

49 changes: 49 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
{
name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: {
localIdentName:
'[name]__[local]--[hash:base64:5]',
},
},
},
{
loader: 'sass-loader',
options: {
implementation: require.resolve('sass'),
additionalData: `@use "sass:math"; @use "variables" as *; @use "mixins" as *;`,
sassOptions: {
includePaths: ['src/styles'],
},
},
},
],
},
],
},
},
],
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['../public'],
};
export default config;
1 change: 1 addition & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<meta name="robots" content="noindex" />
10 changes: 10 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap" rel="stylesheet">
<style>
body {
font-family: "Rubik", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
9 changes: 9 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Preview } from '@storybook/react';

import '../src/styles/globals.scss';

const preview: Preview = {
parameters: {},
};

export default preview;
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v3
Expand Down
Loading

0 comments on commit f306d9d

Please sign in to comment.