Skip to content

Commit

Permalink
feat(tools): create ui-components package and setup Storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenltnguyen committed May 3, 2021
1 parent 11f883a commit c62919c
Show file tree
Hide file tree
Showing 20 changed files with 14,057 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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 -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'
});
13,673 changes: 13,673 additions & 0 deletions tools/ui-components/package-lock.json

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions tools/ui-components/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@freecodecamp/ui",
"version": "0.0.1",
"author": "freeCodeCamp <team@freecodecamp.org>",
"license": "BSD-3-Clause",
"description": "The freeCodeCamp.org open-source UI components",
"main": "index.js",
"dependencies": {
"react": "16.14.0",
"react-dom": "16.14.0"
},
"devDependencies": {
"@babel/core": "^7.14.0",
"@storybook/addon-actions": "^6.2.9",
"@storybook/addon-essentials": "^6.2.9",
"@storybook/addon-links": "^6.2.9",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/react": "^6.2.9",
"babel-loader": "^8.2.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
}
}
1 change: 1 addition & 0 deletions tools/ui-components/src/assets/code-brackets.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/ui-components/src/assets/colors.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/ui-components/src/assets/comments.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/ui-components/src/assets/direction.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/ui-components/src/assets/flow.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/ui-components/src/assets/plugin.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/ui-components/src/assets/repo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c62919c

Please sign in to comment.