Skip to content

Commit e35aed9

Browse files
committed
second commit
1 parent e9de82e commit e35aed9

34 files changed

+11377
-0
lines changed

.babelrc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
[
13+
"@babel/preset-react",
14+
{ "runtime": "automatic", "importSource": "@emotion/react" }
15+
]
16+
],
17+
"plugins": ["@emotion/babel-plugin"]
18+
}

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
*storybook.log

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"jsxSingleQuote": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"tabWidth": 2
6+
}

.storybook/main.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @type { import('@storybook/react-vite').StorybookConfig } */
2+
const config = {
3+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
4+
addons: [
5+
'@storybook/addon-onboarding',
6+
'@storybook/addon-links',
7+
'@storybook/addon-essentials',
8+
'@chromatic-com/storybook',
9+
'@storybook/addon-interactions',
10+
],
11+
framework: {
12+
name: '@storybook/react-vite',
13+
options: {},
14+
},
15+
docs: {
16+
autodocs: 'tag',
17+
},
18+
};
19+
export default config;

.storybook/preview.jsx

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {Global} from "@emotion/react";
2+
3+
import { GlobalStyle } from "../src/shared/global";
4+
5+
/** @type { import('@storybook/react').Preview } */
6+
const preview = {
7+
decorators: [
8+
(Story) => (
9+
<>
10+
<Global styles={GlobalStyle}/>
11+
<Story />
12+
</>
13+
),
14+
],
15+
parameters: {
16+
controls: {
17+
matchers: {
18+
color: /(background|color)$/i,
19+
date: /Date$/i,
20+
},
21+
},
22+
},
23+
};
24+
25+
export default preview;

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 Chroma Software Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package.json

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "learnstorybook-design-system-template",
3+
"version": "0.1.0",
4+
"private": true,
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
7+
"files": [
8+
"dist/**/*",
9+
"README.md"
10+
],
11+
"license": "MIT",
12+
"scripts": {
13+
"build": "rollup -c --bundleConfigAsCjs",
14+
"watch": "rollup --watch -c --bundleConfigAsCjs",
15+
"clean": "rimraf ./dist",
16+
"prebuild": "yarn clean",
17+
"release": "yarn build && auto shipit",
18+
"test": "echo \"Error: no test specified\" && exit 1",
19+
"storybook": "storybook dev -p 6006",
20+
"build-storybook": "storybook build"
21+
},
22+
"devDependencies": {
23+
"@babel/core": "^7.22.5",
24+
"@babel/preset-env": "^7.21.5",
25+
"@babel/preset-react": "^7.18.6",
26+
"@babel/preset-typescript": "^7.21.5",
27+
"@chromatic-com/storybook": "1.3.4",
28+
"@emotion/babel-plugin": "^11.11.0",
29+
"@emotion/react": "^11.11.1",
30+
"@emotion/styled": "^11.11.0",
31+
"@rollup/plugin-babel": "^6.0.3",
32+
"@rollup/plugin-commonjs": "^24.1.0",
33+
"@rollup/plugin-node-resolve": "^15.0.2",
34+
"@rollup/plugin-terser": "^0.4.3",
35+
"@storybook/addon-essentials": "^8.0.10",
36+
"@storybook/addon-interactions": "^8.0.10",
37+
"@storybook/addon-links": "^8.0.10",
38+
"@storybook/addon-onboarding": "^8.0.10",
39+
"@storybook/blocks": "^8.0.10",
40+
"@storybook/react": "^8.0.10",
41+
"@storybook/react-vite": "^8.0.10",
42+
"@storybook/test": "^8.0.10",
43+
"@vitejs/plugin-react": "^3.1.0",
44+
"auto": "^10.3.0",
45+
"boxen": "^5.0.1",
46+
"dedent": "^0.7.0",
47+
"npm-run-all": "^4.1.5",
48+
"polished": "^4.2.2",
49+
"prettier": "^2.8.8",
50+
"prop-types": "^15.8.1",
51+
"react": "^18.0.0",
52+
"react-dom": "^18.0.0",
53+
"rimraf": "^3.0.2",
54+
"rollup": "^3.25.0",
55+
"rollup-plugin-dts": "^5.3.0",
56+
"rollup-plugin-peer-deps-external": "^2.2.4",
57+
"storybook": "^8.0.10",
58+
"vite": "^4.1.4",
59+
"zx": "^1.14.1"
60+
},
61+
"peerDependencies": {
62+
"@emotion/react": "^11.11.1",
63+
"@emotion/styled": "^11.11.0",
64+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
65+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
66+
},
67+
"peerDependenciesMeta": {
68+
"react": {
69+
"optional": true
70+
},
71+
"react-dom": {
72+
"optional": true
73+
}
74+
},
75+
"resolutions": {
76+
"jackspeak": "2.1.1"
77+
}
78+
}

rollup.config.mjs

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import resolve from '@rollup/plugin-node-resolve';
2+
import commonjs from '@rollup/plugin-commonjs';
3+
import terser from '@rollup/plugin-terser';
4+
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
5+
import { babel } from '@rollup/plugin-babel';
6+
7+
// This is required to read package.json file when
8+
// using Native ES modules in Node.js
9+
// https://rollupjs.org/command-line-interface/#importing-package-json
10+
import { createRequire } from 'node:module';
11+
const requireFile = createRequire(import.meta.url);
12+
const packageJson = requireFile('./package.json');
13+
14+
export default [
15+
{
16+
input: 'src/index.js',
17+
output: [
18+
{
19+
file: packageJson.main,
20+
format: 'cjs',
21+
sourcemap: true,
22+
},
23+
{
24+
file: packageJson.module,
25+
format: 'esm',
26+
exports: 'named',
27+
sourcemap: true,
28+
},
29+
],
30+
plugins: [
31+
peerDepsExternal(),
32+
resolve({
33+
extensions: ['.js', '.jsx'],
34+
}),
35+
commonjs(),
36+
terser(),
37+
babel({
38+
extensions: ['.js', '.jsx'],
39+
exclude: 'node_modules/**',
40+
}),
41+
],
42+
external: ['react', 'react-dom', '@emotion/react', '@emotion/styled'],
43+
},
44+
];

src/.babelrc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
[
13+
"@babel/preset-react",
14+
{ "runtime": "automatic", "importSource": "@emotion/react" }
15+
]
16+
],
17+
"plugins": ["@emotion/babel-plugin"]
18+
}

0 commit comments

Comments
 (0)