Skip to content

Commit

Permalink
feat(tools): create ui-components package and setup Storybook (#41920)
Browse files Browse the repository at this point in the history
* feat(client): basic Storybook setup

* Revert "feat(client): basic Storybook setup"

This reverts commit f55e249.

* feat(tools): create ui-components package and setup Storybook

* Add ui-components to lerna.json
  • Loading branch information
huyenltnguyen committed May 10, 2021
1 parent 83943de commit 3efe3fa
Show file tree
Hide file tree
Showing 21 changed files with 14,074 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"tools/contributor/one-off-scripts",
"tools/crowdin",
"tools/scripts/build",
"tools/scripts/seed"
"tools/scripts/seed",
"tools/ui-components"
],
"command": {
"bootstrap": {
Expand All @@ -24,7 +25,8 @@
"tools/contributor/dashboard-app/server",
"tools/contributor/lib/",
"tools/contributor/one-off-scripts",
"tools/crowdin"
"tools/crowdin",
"tools/ui-components"
]
}
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"start": "npm-run-all ensure-env -p develop:server serve:client",
"start-ci": "npm-run-all ensure-env -p start:server serve:client",
"start:server": "cd ./api-server && npm start",
"storybook": "cd ./tools/ui-components && npm run storybook",
"test": "npm-run-all ensure-env build:curriculum build-workers -p test:*",
"test-curriculum-full-output": "cd ./curriculum && npm run test:full-output",
"test:client": "cd ./client && npm test",
Expand Down
8 changes: 8 additions & 0 deletions tools/ui-components/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.js'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-postcss'
]
};
6 changes: 6 additions & 0 deletions tools/ui-components/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/addons';
import theme from './theme';

addons.setConfig({
theme
});
9 changes: 9 additions & 0 deletions tools/ui-components/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
}
};
8 changes: 8 additions & 0 deletions tools/ui-components/.storybook/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { create } from '@storybook/theming';

export default create({
base: 'light',
brandTitle: 'freeCodeCamp.org',
brandImage:
'https://cdn.freecodecamp.org/platform/universal/fcc_secondary.svg'
});

0 comments on commit 3efe3fa

Please sign in to comment.