-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add storybook and create initial setup... * Rename example button (to avoid name collision) * Add some basic v3 components * Redesign icon storybook component * Add github pages action * Fix linter issues and remove content param from organism/content now * Ready to address lock conflicts * Cleanup some example files.
- Loading branch information
1 parent
955905c
commit 02d8b26
Showing
46 changed files
with
7,734 additions
and
1,986 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Workflow name | ||
name: Build and Publish Storybook to GitHub Pages | ||
|
||
on: | ||
# Event for the workflow to run on | ||
push: | ||
branches: | ||
- 'dev' # Replace with the branch you want to deploy from | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# List of jobs | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
# Job steps | ||
steps: | ||
# Manual Checkout | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# Set up Node | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow | ||
- uses: bitovi/[email protected] | ||
with: | ||
install_command: yarn install # default: npm ci | ||
build_command: yarn build-storybook # default: npm run build-storybook | ||
path: storybook-static # default: dist/storybook | ||
checkout: false # default: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,6 @@ dist-ssr | |
*.sw? | ||
|
||
.next/ | ||
|
||
*storybook.log | ||
/storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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-essentials", | ||
"@chromatic-com/storybook", | ||
"@storybook/addon-interactions", | ||
"@storybook/addon-themes", | ||
// "storybook-addon-pseudo-states" | ||
], | ||
framework: { | ||
name: "@storybook/nextjs", | ||
options: {}, | ||
}, | ||
staticDirs: [ | ||
"../public", | ||
{ | ||
from: "../src/assets/fonts", | ||
to: "src/assets/fonts" | ||
} | ||
], | ||
managerHead: (head) => ` | ||
${head} | ||
<meta name="robots" content="noindex" /> | ||
`, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import type { Preview } from "@storybook/react"; | ||
import localFont from "next/font/local"; | ||
import "../src/app/globals.css"; | ||
|
||
import { | ||
withThemeByClassName, | ||
withThemeByDataAttribute, | ||
} from "@storybook/addon-themes"; | ||
|
||
// Include font using next/font | ||
const ppPangram = localFont({ | ||
src: [ | ||
{ | ||
path: "../src/assets/fonts/PPPangramSansRounded-Regular/PPPangramSansRounded-Regular.woff2", | ||
weight: "400", | ||
style: "normal", | ||
}, | ||
{ | ||
path: "../src/assets/fonts/PPPangramSansRounded-Medium/PPPangramSansRounded-Medium.woff2", | ||
weight: "500", | ||
style: "normal", | ||
}, | ||
{ | ||
path: "../src/assets/fonts/PPPangramSansRounded-Semibold/PPPangramSansRounded-Semibold.woff2", | ||
weight: "600", | ||
style: "normal", | ||
}, | ||
{ | ||
path: "../src/assets/fonts/PPPangramSansRounded-Bold/PPPangramSansRounded-Bold.woff2", | ||
weight: "700", | ||
style: "normal", | ||
}, | ||
], | ||
variable: "--font-pppangram", | ||
}); | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<main className={ppPangram.className}> | ||
<Story /> | ||
</main> | ||
), | ||
withThemeByClassName({ | ||
themes: { | ||
light: 'light', | ||
dark: 'dark', | ||
}, | ||
defaultTheme: 'light', | ||
}), | ||
withThemeByDataAttribute({ | ||
themes: { | ||
light: "light", | ||
dark: "dark", | ||
}, | ||
defaultTheme: "light", | ||
attributeName: "data-mode", | ||
}), | ||
], | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.