Skip to content

Commit

Permalink
feat: add storybook to visualizate components (#62)
Browse files Browse the repository at this point in the history
* feat: add storybook to visualizate components

* fix: add fonts

* feat: add autodocs by default

* feat: add readme

---------

Co-authored-by: Paulo Victor <[email protected]>
  • Loading branch information
diogocaronte and PiluVitu committed Feb 21, 2024
1 parent ea0bbcf commit 947d574
Show file tree
Hide file tree
Showing 13 changed files with 5,312 additions and 360 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": ["airbnb-base"],
"extends": [
"airbnb-base",
"plugin:storybook/recommended"
],
"env": {
"browser": true
},
Expand Down
18 changes: 18 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type { import('@storybook/html-vite').StorybookConfig } */
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/html-vite',
options: {},
},
docs: {
autodocs: true,
defaultName: 'Documentation',
},
};
export default config;
6 changes: 6 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<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=Montserrat:wght@400;700&family=Noto+Sans:wght@500&display=swap"
rel="stylesheet"
/>
15 changes: 15 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import '../src/styles/base.scss';

/** @type { import('@storybook/html').Preview } */
const preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@
"stylelint": "stylelint \"**/*.scss\"",
"prettier": "prettier . --check --ignore-unknown",
"prettier:fix": "prettier . --write --ignore-unknown",
"code-style": "concurrently \"pnpm lint\" \"pnpm stylelint\" \"pnpm prettier\""
"code-style": "concurrently \"pnpm lint\" \"pnpm stylelint\" \"pnpm prettier\"",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"devDependencies": {
"@storybook/addon-essentials": "8.0.0-alpha.16",
"@storybook/addon-interactions": "8.0.0-alpha.16",
"@storybook/addon-links": "8.0.0-alpha.16",
"@storybook/blocks": "8.0.0-alpha.16",
"@storybook/html": "8.0.0-alpha.16",
"@storybook/html-vite": "8.0.0-alpha.16",
"@storybook/test": "8.0.0-alpha.16",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"cz-format-extension": "^1.5.1",
Expand All @@ -27,12 +36,14 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.15",
"husky": "^8.0.0",
"jsdom": "^23.2.0",
"lint-staged": "^15.2.0",
"prettier": "^3.2.4",
"reset-css": "^5.0.2",
"sass": "^1.70.0",
"storybook": "8.0.0-alpha.16",
"stylelint": "^16.2.0",
"stylelint-color-format": "^1.1.0",
"stylelint-config-sass-guidelines": "11.0.0",
Expand Down
Loading

0 comments on commit 947d574

Please sign in to comment.