Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .babelrc.json

This file was deleted.

41 changes: 27 additions & 14 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
}
);
53 changes: 32 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
# Logs
logs
*.log
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.eslintcache

npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?


build-storybook.log

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
6 changes: 4 additions & 2 deletions .storybook/main.js → .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/** @type { import('@storybook/react-vite').StorybookConfig } */
const config = {
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
staticDirs: ["../public"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
Expand Down
6 changes: 3 additions & 3 deletions .storybook/preview.jsx → .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type { import('@storybook/react').Preview } */
const preview = {
import type { Preview } from "@storybook/react";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.5.0.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.0.cjs
48 changes: 32 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<h1 align="center">
Chromatic's Design Systems for Developers tutorial example app
Chromatic's Design Systems for Developers tutorial example app
</h1>

This application ships with the main React configuration files you'll need to get up and running fast.
Expand Down Expand Up @@ -40,44 +40,60 @@ This application ships with the main React configuration files you'll need to ge
## 🔎 What's inside?

A quick look at the top-level files and directories included with this template.

.
.
├── .storybook
├── .yarn
├── node_modules
├── public
├── src
├── .eslintrc.cjs
├── .babelrc.json
├── .gitignore
├── .index.html
├── .yarnrc.yml
├── index.html
├── LICENSE
├── package.json
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.node.json
├── yarn.lock
├── vite.config.js
└── README.md

1. **`.storybook`**: This directory contains Storybook's [configuration](https://storybook.js.org/docs/react/configure/overview) files.
1. **`.storybook`**: This directory contains Storybook's [configuration](https://storybook.js.org/docs/configure) files.

2. **`node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages).
2. **`.yarn`**: This directory contains the configuration files for Yarn including the cache and the global packages.

3. **`public`**: This directory will contain the development and production build of the site.
3. **`node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages).

4. **`src`**: This directory will contain all of the code related to what you will see on your application.
4. **`public`**: This directory will contain the development and production build of the site.

5. **`.eslintrc.cjs`**: This is a configuration file for [ESLint](https://eslint.org/), a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.
5. **`src`**: This directory will contain all of the code related to what you will see on your application.

6. **`.babelrc.json`**: This is a configuration file for [Babel](https://babeljs.io/), a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.
6. **`.eslintrc.cjs`**: This is a configuration file for [ESLint](https://eslint.org/), a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.

7. **`.gitignore`**: This file tells git which files it should not track or maintain during the development process of your project.

8. **`.index.html`**: This is the HTML page that is served when generating a development or production build.
8. **`.yarnrc.yml`**: This file contains the configuration for Yarn. It's used to define the project's settings, such as caching and other settings.

9. **`.index.html`**: This is the HTML page that is served when generating a development or production build.

10. **`package.json`**: Standard manifest file for Node.js projects, which typically includes project specific metadata (such as the project's name, the author among other information). It's based on this file that npm will know which packages are necessary to the project.

11. **`yarn.lock`**: This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(Do not change it manually).**

12. **`tsconfig.app.json`**: This file contains the TypeScript compiler options for the project.

13. **`tsconfig.json`**: This file is the root TypeScript configuration file that specifies the root files and the compiler options required to compile the project.

14. **`tsconfig.json`**: This file is the root TypeScript configuration file that specifies the root files and the compiler options that could be extended by other configuration files in the project.

9. **`package.json`**: Standard manifest file for Node.js projects, which typically includes project specific metadata (such as the project's name, the author among other information). It's based on this file that npm will know which packages are necessary to the project.
15. **`tsconfig.node.json`**: This file contains the TypeScript compiler options required to manage the Node.js environment in the project configuration files. Used to help distinguish between configurations for different parts of the project.

10. **`yarn.lock`**: This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(Do not change it manually).**
16. **`tsconfig.node.json`**: This file contains the TypeScript compiler options required to manage the Node.js environment in the project configuration files. Used to help distinguish between configurations for different parts of the project.

11. **`vite.config.js`**: This is the configuration file for [Vite](https://vitejs.dev/), a build tool that aims to provide a faster and leaner development experience for modern web projects.
17. **`vite.config.ts`**: This is the configuration file for [Vite](https://vitejs.dev/), a build tool that aims to provide a faster and leaner development experience for modern web projects.

12. **`README.md`**: A text file containing useful reference information about the project.
18. **`README.md`**: A text file containing useful reference information about the project.

## Contribute

Expand Down
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
43 changes: 23 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,30 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/preset-react": "^7.22.15",
"@emotion/babel-plugin": "^11.11.0",
"@storybook/addon-essentials": "^8.3.3",
"@storybook/addon-interactions": "^8.3.3",
"@storybook/addon-links": "^8.3.3",
"@storybook/blocks": "^8.3.3",
"@storybook/react": "^8.3.3",
"@storybook/react-vite": "^8.3.3",
"@storybook/test": "^8.3.3",
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.38.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"prop-types": "^15.8.1",
"storybook": "^8.3.3",
"vite": "^4.3.9"
"@eslint/js": "^9.9.0",
"@storybook/addon-essentials": "^8.5.6",
"@storybook/addon-interactions": "^8.5.6",
"@storybook/addon-links": "^8.5.6",
"@storybook/blocks": "^8.5.6",
"@storybook/react": "^8.5.6",
"@storybook/react-vite": "^8.5.6",
"@storybook/test": "^8.5.6",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^9.9.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-storybook": "^0.11.2",
"globals": "^15.9.0",
"storybook": "^8.5.6",
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1"
},
"resolutions": {
"jackspeak": "2.1.1"
}
},
"packageManager": "[email protected]"
}
42 changes: 21 additions & 21 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
padding: 2em;
}

.read-the-docs {
color: #888;
color: #888;
}
2 changes: 1 addition & 1 deletion src/App.jsx → src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function App() {
count is {count}
</button>
<p>
Edit <code>src/App.jsx</code> and save to test HMR
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import type { Meta, StoryObj } from "@storybook/react";

import UserItem from "./UserItem";

export default {
const meta = {
component: UserItem,
title: "components/UserItem",
tags: ["autodocs"],
};
} satisfies Meta<typeof UserItem>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Simple = {
export const Simple: Story = {
args: {
user: {
id: "1",
name: "Dominic Nyugen",
avatarUrl: "https://avatars2.githubusercontent.com/u/263385",
},
Expand Down
Loading