Skip to content

Commit 83b2287

Browse files
committed
button component
0 parents  commit 83b2287

26 files changed

+14996
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"value":{"id":"9OmnLniKycmAjYPw3Jl4-","lastUsed":1717084781633},"type":"Object","created":"2024-05-30T15:59:41.633Z","ttl":0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"value":1717083275121,"type":"Number","created":"2024-05-30T15:34:35.122Z","ttl":0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"value":{"scaffolded-empty":{"body":{"eventType":"scaffolded-empty","eventId":"6EwoLaixB9b4xrF2dunQ3","sessionId":"9OmnLniKycmAjYPw3Jl4-","payload":{"packageManager":"npm","projectType":"react-vite-ts","metadataErrorMessage":"No configuration files have been found in your configDir: .storybook.\nStorybook needs a \"main.js\" file, please add it.\n\nYou can pass a --config-dir flag to tell Storybook, where your main.js file is located at).\n\nMore info: https://storybook.js.org/docs/configure\n"},"context":{"inCI":false,"isTTY":true,"platform":"Linux","cliVersion":"8.1.5"}},"timestamp":1717083275884},"init":{"body":{"eventType":"init","eventId":"3hn60pL7tiCakqp_d2dPI","sessionId":"9OmnLniKycmAjYPw3Jl4-","metadata":{"generatedAt":1717083867725,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{},"packageManager":{"type":"npm","version":"10.5.0"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"8.1.5","storybookVersionSpecifier":"^8.1.5","language":"typescript","storybookPackages":{"@storybook/blocks":{"version":"8.1.5"},"@storybook/react":{"version":"8.1.5"},"@storybook/react-vite":{"version":"8.1.5"},"@storybook/test":{"version":"8.1.5"},"eslint-plugin-storybook":{"version":"0.8.0"},"storybook":{"version":"8.1.5"}},"addons":{"@storybook/addon-onboarding":{"version":"8.1.5"},"@storybook/addon-links":{"version":"8.1.5"},"@storybook/addon-essentials":{"version":"8.1.5"},"@chromatic-com/storybook":{"version":"1.5.0"},"@storybook/addon-interactions":{"version":"8.1.5"}}},"payload":{"projectType":"REACT"},"context":{"inCI":false,"isTTY":true,"platform":"Linux","cliVersion":"8.1.5"}},"timestamp":1717083868631},"canceled":{"body":{"eventType":"canceled","eventId":"JTr6hVoSZLRDNBd6qq7hI","sessionId":"9OmnLniKycmAjYPw3Jl4-","payload":{"eventType":"init"},"context":{"inCI":false,"isTTY":true,"platform":"Linux","cliVersion":"8.1.5"}},"timestamp":1717084781635}},"type":"Object","created":"2024-05-30T15:59:41.635Z","ttl":0}

.eslintrc.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'],
5+
ignorePatterns: ['dist', '.eslintrc.cjs'],
6+
parser: '@typescript-eslint/parser',
7+
plugins: ['react-refresh'],
8+
rules: {
9+
'react-refresh/only-export-components': [
10+
'warn',
11+
{ allowConstantExport: true },
12+
],
13+
},
14+
}

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.storybook/main.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { StorybookConfig } from "@storybook/react-vite";
2+
import tsconfigPaths from "vite-tsconfig-paths";
3+
import path from "path";
4+
5+
6+
const config: StorybookConfig = {
7+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
8+
addons: [
9+
"@storybook/addon-onboarding",
10+
"@storybook/addon-links",
11+
"@storybook/addon-essentials",
12+
"@chromatic-com/storybook",
13+
"@storybook/addon-interactions",
14+
"@storybook/addon-styling-webpack"
15+
],
16+
framework: {
17+
name: "@storybook/react-vite",
18+
options: {},
19+
},
20+
docs: {
21+
autodocs: "tag",
22+
},
23+
viteFinal: async (config) => {
24+
config.plugins?.push(
25+
tsconfigPaths({
26+
projects: [path.resolve(path.dirname(__dirname), "tsconfig.json")],
27+
})
28+
);
29+
30+
return config;
31+
},
32+
};
33+
export default config;

.storybook/preview.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Preview } from "@storybook/react";
2+
import '../src/index.css';
3+
4+
const preview: Preview = {
5+
parameters: {
6+
controls: {
7+
matchers: {
8+
color: /(background|color)$/i,
9+
date: /Date$/i,
10+
},
11+
},
12+
},
13+
};
14+
15+
export default preview;

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13+
14+
- Configure the top-level `parserOptions` property like this:
15+
16+
```js
17+
export default {
18+
// other rules...
19+
parserOptions: {
20+
ecmaVersion: 'latest',
21+
sourceType: 'module',
22+
project: ['./tsconfig.json', './tsconfig.node.json'],
23+
tsconfigRootDir: __dirname,
24+
},
25+
}
26+
```
27+
28+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)