Skip to content

Commit

Permalink
Tutorial initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes committed Dec 21, 2023
0 parents commit e2984d1
Show file tree
Hide file tree
Showing 56 changed files with 10,057 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.cjs
@@ -0,0 +1,9 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution');
module.exports = {
root: true,
'extends': ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/eslint-config-prettier/skip-formatting', 'plugin:storybook/recommended'],
parserOptions: {
ecmaVersion: 'latest'
}
};
23 changes: 23 additions & 0 deletions .gitignore
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
build-storybook.log

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions .prettierrc.json
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
18 changes: 18 additions & 0 deletions .storybook/main.js
@@ -0,0 +1,18 @@
/** @type { import('@storybook/vue3-vite').StorybookConfig } */
const config = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
staticDirs: ["../public"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/vue3-vite",
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
14 changes: 14 additions & 0 deletions .storybook/preview.js
@@ -0,0 +1,14 @@
/** @type { import('@storybook/vue3').Preview } */
const preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 Chroma Software Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
97 changes: 97 additions & 0 deletions README.md
@@ -0,0 +1,97 @@
<p align="center">
<a href="https://www.chromatic.com/">
<img alt="Chromatic" src="https://avatars2.githubusercontent.com/u/24584319?s=200&v=4" width="60" />
</a>
</p>

<h1 align="center">
Chromatic's Intro to Storybook Vue template
</h1>

This template ships with the main Vue and Storybook configuration files you'll need to get up and running fast.

## 🚅 Quick start

1. **Create the application.**

Use [degit](https://github.com/Rich-Harris/degit) to get this template.

```shell
# Clone the template
npx degit chromaui/intro-storybook-vue-template taskbox
```

1. **Install the dependencies.**

Navigate into your new site’s directory and install the necessary dependencies.

```shell
# Navigate to the directory
cd taskbox/

# Install the dependencies
yarn
```

1. **Open the source code and start editing!**

Open the `taskbox` directory in your code editor of choice and building your first component!

1. **Browse your stories!**

Run `yarn storybook` to see your component's stories at `http://localhost:6006`

## 🔎 What's inside?

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

.
├── .storybook
├── node_modules
├── public
├── src
├── .gitignore
├── .eslintrc.cjs
├── .prettierrc.json
├── index.html
├── LICENSE
├── yarn.lock
├── package.json
├── vite.config.js
└── README.md

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

2. **`node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages).

3. **`public`**: This directory will contain the development and production build of the site.

4. **`src`**: This directory will contain all of the code related to what you will see on your application.

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

6. **`.eslintrc.cjs`**: This file contains the configuration for ESLint.

7. **`.prettierrc.json`**: This file contains the configuration for Prettier.

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

9. **`LICENSE`**: The template is licensed under the MIT licence.

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).**

11. **`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.

12. **`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.

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

## Contribute

If you encounter an issue with the template, we encourage you to open an issue in this template's repository.

## Learning Storybook

1. Read our introductory tutorial at [Learn Storybook](https://storybook.js.org/tutorials/intro-to-storybook/vue/en/get-started/).
2. Learn how to transform your component libraries into design systems in our [Design Systems for Developers](https://storybook.js.org/tutorials/design-systems-for-developers/) tutorial.
3. See our official documentation at [Storybook](https://storybook.js.org/).
13 changes: 13 additions & 0 deletions index.html
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
53 changes: 53 additions & 0 deletions package.json
@@ -0,0 +1,53 @@
{
"name": "intro-storybook-vue-template",
"version": "0.2.0",
"private": true,
"description": "Starter template to get up and running quickly with Vue and Storybook",
"author": "Chromatic <https://chromatic.com/>",
"repository": {
"type": "git",
"url": "https://github.com/chromaui/intro-storybook-vue-template"
},
"bugs": {
"url": "https://github.com/chromaui/intro-storybook-vue-template/issues"
},
"license": "MIT",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
"format": "prettier --write src/",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"init-msw": "msw init public/"
},
"dependencies": {
"vue": "^3.2.47"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
"@storybook/addon-essentials": "^7.6.6",
"@storybook/addon-interactions": "^7.6.6",
"@storybook/addon-links": "^7.6.6",
"@storybook/blocks": "^7.6.6",
"@storybook/test": "^7.6.6",
"@storybook/vue3": "^7.6.6",
"@storybook/vue3-vite": "^7.6.6",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/eslint-config-prettier": "^7.1.0",
"eslint": "^8.34.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-vue": "^9.9.0",
"msw": "^1.2.1",
"msw-storybook-addon": "^1.10.0",
"prettier": "^2.8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^7.6.6",
"vite": "^4.1.4"
},
"resolutions": {
"jackspeak": "2.1.1"
}
}
Binary file added public/favicon.ico
Binary file not shown.
47 changes: 47 additions & 0 deletions src/App.vue
@@ -0,0 +1,47 @@
<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
</script>

<template>
<header>
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />

<div class="wrapper">
<HelloWorld msg="You did it!" />
</div>
</header>

<main>
<TheWelcome />
</main>
</template>

<style scoped>
header {
line-height: 1.5;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
}
</style>
74 changes: 74 additions & 0 deletions src/assets/base.css
@@ -0,0 +1,74 @@
/* color palette from <https://github.com/vuejs/theme> */
:root {
--vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2;

--vt-c-black: #181818;
--vt-c-black-soft: #222222;
--vt-c-black-mute: #282828;

--vt-c-indigo: #2c3e50;

--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);

--vt-c-text-light-1: var(--vt-c-indigo);
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
--vt-c-text-dark-1: var(--vt-c-white);
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
}

/* semantic color variables for this project */
:root {
--color-background: var(--vt-c-white);
--color-background-soft: var(--vt-c-white-soft);
--color-background-mute: var(--vt-c-white-mute);

--color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1);

--color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1);

--section-gap: 160px;
}

@media (prefers-color-scheme: dark) {
:root {
--color-background: var(--vt-c-black);
--color-background-soft: var(--vt-c-black-soft);
--color-background-mute: var(--vt-c-black-mute);

--color-border: var(--vt-c-divider-dark-2);
--color-border-hover: var(--vt-c-divider-dark-1);

--color-heading: var(--vt-c-text-dark-1);
--color-text: var(--vt-c-text-dark-2);
}
}

*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
position: relative;
font-weight: normal;
}

body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition: color 0.5s, background-color 0.5s;
line-height: 1.6;
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 15px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Binary file added src/assets/font/OpenSans-Light-webfont.eot
Binary file not shown.

0 comments on commit e2984d1

Please sign in to comment.