├── .npmrc
├── static
├── favicon.ico
└── robots.txt
├── src
├── global.d.ts
├── routes
│ ├── $layout.svelte
│ └── index.svelte
├── app.scss
├── app.html
├── stories
│ ├── Counter.stories.svelte
│ ├── header.css
│ ├── Page.stories.svelte
│ ├── Header.stories.svelte
│ ├── button.css
│ ├── Button.svelte
│ ├── Button.stories.svelte
│ ├── assets
│ │ ├── direction.svg
│ │ ├── flow.svg
│ │ ├── code-brackets.svg
│ │ ├── comments.svg
│ │ ├── repo.svg
│ │ ├── plugin.svg
│ │ ├── stackalt.svg
│ │ └── colors.svg
│ ├── page.css
│ ├── Header.svelte
│ ├── Page.svelte
│ └── Introduction.stories.mdx
└── lib
│ └── Counter.svelte
├── .gitignore
├── .storybook
├── preview.cjs
└── main.cjs
├── tailwind.config.cjs
├── svelte.config.cjs
├── README.md
├── package.json
├── tsconfig.json
└── LICENSE
/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
2 |
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tejasag/sveltetron-9000/HEAD/static/favicon.ico
--------------------------------------------------------------------------------
/static/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/global.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
--------------------------------------------------------------------------------
/src/routes/$layout.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
Sveltetron 9000
7 |
8 | The Svelte template you needed!
9 |
10 |
11 |
12 | Checkout the project documentation on
13 | Github
14 |
15 |
16 |
17 |
22 |
--------------------------------------------------------------------------------
/src/stories/button.css:
--------------------------------------------------------------------------------
1 | .storybook-button {
2 | font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3 | font-weight: 700;
4 | border: 0;
5 | border-radius: 3em;
6 | cursor: pointer;
7 | display: inline-block;
8 | line-height: 1;
9 | }
10 | .storybook-button--primary {
11 | color: white;
12 | background-color: #1ea7fd;
13 | }
14 | .storybook-button--secondary {
15 | color: #333;
16 | background-color: transparent;
17 | box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
18 | }
19 | .storybook-button--small {
20 | font-size: 12px;
21 | padding: 10px 16px;
22 | }
23 | .storybook-button--medium {
24 | font-size: 14px;
25 | padding: 11px 20px;
26 | }
27 | .storybook-button--large {
28 | font-size: 16px;
29 | padding: 12px 24px;
30 | }
31 |
--------------------------------------------------------------------------------
/svelte.config.cjs:
--------------------------------------------------------------------------------
1 | const sveltePreprocess = require('svelte-preprocess');
2 | const node = require('@sveltejs/adapter-node');
3 | const pkg = require('./package.json');
4 |
5 | /** @type {import('@sveltejs/kit').Config} */
6 | module.exports = {
7 | // Consult https://github.com/sveltejs/svelte-preprocess
8 | // for more information about preprocessors
9 | preprocess: sveltePreprocess({
10 | postcss: {
11 | plugins: [
12 | require("tailwindcss"),
13 | require("autoprefixer")
14 | ]
15 | }
16 | }),
17 | kit: {
18 | // By default, `npm run build` will create a standard Node app.
19 | // You can create optimized builds for different platforms by
20 | // specifying a different adapter
21 | adapter: node(),
22 |
23 | // hydrate the element in src/app.html
24 | target: '#svelte',
25 |
26 | vite: {
27 | ssr: {
28 | noExternal: Object.keys(pkg.dependencies || {})
29 | }
30 | }
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | The ultimate SvelteKit starter template which includes configuraion for
4 | - [TailwindCSS](https://tailwindcss.com),
5 | - [Storybook](https://storybook.js.org),
6 | - [TypeScript](https://typescriptlang.org/),
7 | - [Sass](https://sass-lang.com/)
8 | and more!
9 |
10 | # Usage
11 | - Use the template using github or clone the repository
12 | ```
13 | git clone https://github.com/tejasag/sveltetron-9000
14 | ```
15 |
16 | - Install the libraries
17 | ```js
18 | // with yarn
19 | yarn
20 | // or with npm
21 | npm i
22 | // or with pnpm
23 | pnpm install
24 | ```
25 |
26 | - To run the Svelte server
27 | ```js
28 | yarn dev
29 | // or
30 | npm run dev
31 | ```
32 |
33 | - To run the Storybook server
34 | ```js
35 | yarn storybook
36 | // or
37 | npm run storybook
38 | ```
39 |
40 | ## Having troubles?
41 | Open an issue and I'll try to help as soon as I can!
42 |
43 | ---
44 |
45 | Copyright 2021-present Tejas Agarwal
46 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sveltetron-9000",
3 | "version": "0.0.1",
4 | "scripts": {
5 | "dev": "svelte-kit dev",
6 | "build": "svelte-kit build",
7 | "start": "svelte-kit start",
8 | "storybook": "start-storybook -p 6006",
9 | "build-storybook": "build-storybook"
10 | },
11 | "devDependencies": {
12 | "@babel/core": "^7.13.14",
13 | "@storybook/addon-actions": "^6.2.2",
14 | "@storybook/addon-essentials": "^6.2.2",
15 | "@storybook/addon-links": "^6.2.2",
16 | "@storybook/addon-svelte-csf": "^1.0.0",
17 | "@storybook/svelte": "^6.2.2",
18 | "@sveltejs/adapter-node": "next",
19 | "@sveltejs/kit": "next",
20 | "@tailwindcss/jit": "^0.1.18",
21 | "autoprefixer": "^10.2.5",
22 | "babel-loader": "^8.2.2",
23 | "postcss": "^8.2.9",
24 | "sass": "^1.0.0",
25 | "svelte": "^3.37.0",
26 | "svelte-loader": "^3.0.0",
27 | "svelte-preprocess": "^4.0.0",
28 | "tailwindcss": "^2.0.4",
29 | "tslib": "^2.0.0",
30 | "typescript": "^4.0.0",
31 | "vite": "^2.1.0"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/stories/Button.svelte:
--------------------------------------------------------------------------------
1 |
35 |
36 |
41 | {label}
42 |
43 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "moduleResolution": "node",
4 | "module": "es2020",
5 | "lib": ["es2020"],
6 | "target": "es2019",
7 | /**
8 | svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
9 | to enforce using \`import type\` instead of \`import\` for Types.
10 | */
11 | "importsNotUsedAsValues": "error",
12 | "isolatedModules": true,
13 | "resolveJsonModule": true,
14 | /**
15 | To have warnings/errors of the Svelte compiler at the correct position,
16 | enable source maps by default.
17 | */
18 | "sourceMap": true,
19 | "esModuleInterop": true,
20 | "skipLibCheck": true,
21 | "forceConsistentCasingInFileNames": true,
22 | "baseUrl": ".",
23 | "allowJs": true,
24 | "checkJs": true,
25 | "paths": {
26 | "$app/*": [".svelte/dev/runtime/app/*", ".svelte/build/runtime/app/*"],
27 | "$service-worker": [".svelte/build/runtime/service-worker"],
28 | "$lib/*": ["src/lib/*"]
29 | }
30 | },
31 | "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
32 | }
33 |
--------------------------------------------------------------------------------
/src/stories/Button.stories.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
19 |
20 |
21 |
22 |
23 |
24 |
31 |
32 |
38 |
45 |
46 |
53 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2021 - present tejasag
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.
22 |
--------------------------------------------------------------------------------
/src/stories/assets/direction.svg:
--------------------------------------------------------------------------------
1 |
illustration/direction
--------------------------------------------------------------------------------
/src/stories/page.css:
--------------------------------------------------------------------------------
1 | section {
2 | font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3 | font-size: 14px;
4 | line-height: 24px;
5 | padding: 48px 20px;
6 | margin: 0 auto;
7 | max-width: 600px;
8 | color: #333;
9 | }
10 |
11 | h2 {
12 | font-weight: 900;
13 | font-size: 32px;
14 | line-height: 1;
15 | margin: 0 0 4px;
16 | display: inline-block;
17 | vertical-align: top;
18 | }
19 |
20 | p {
21 | margin: 1em 0;
22 | }
23 |
24 | a {
25 | text-decoration: none;
26 | color: #1ea7fd;
27 | }
28 |
29 | ul {
30 | padding-left: 30px;
31 | margin: 1em 0;
32 | }
33 |
34 | li {
35 | margin-bottom: 8px;
36 | }
37 |
38 | .tip {
39 | display: inline-block;
40 | border-radius: 1em;
41 | font-size: 11px;
42 | line-height: 12px;
43 | font-weight: 700;
44 | background: #e7fdd8;
45 | color: #66bf3c;
46 | padding: 4px 12px;
47 | margin-right: 10px;
48 | vertical-align: top;
49 | }
50 |
51 | .tip-wrapper {
52 | font-size: 13px;
53 | line-height: 20px;
54 | margin-top: 40px;
55 | margin-bottom: 40px;
56 | }
57 |
58 | .tip-wrapper svg {
59 | display: inline-block;
60 | height: 12px;
61 | width: 12px;
62 | margin-right: 4px;
63 | vertical-align: top;
64 | margin-top: 3px;
65 | }
66 |
67 | .tip-wrapper svg path {
68 | fill: #1ea7fd;
69 | }
70 |
--------------------------------------------------------------------------------
/src/stories/assets/flow.svg:
--------------------------------------------------------------------------------
1 |
illustration/flow
--------------------------------------------------------------------------------
/src/stories/assets/code-brackets.svg:
--------------------------------------------------------------------------------
1 |
illustration/code-brackets
--------------------------------------------------------------------------------
/src/stories/assets/comments.svg:
--------------------------------------------------------------------------------
1 |
illustration/comments
--------------------------------------------------------------------------------
/src/stories/Header.svelte:
--------------------------------------------------------------------------------
1 |
21 |
22 |
49 |
--------------------------------------------------------------------------------
/src/stories/assets/repo.svg:
--------------------------------------------------------------------------------
1 |
illustration/repo
--------------------------------------------------------------------------------
/src/stories/assets/plugin.svg:
--------------------------------------------------------------------------------
1 |
illustration/plugin
--------------------------------------------------------------------------------
/src/stories/assets/stackalt.svg:
--------------------------------------------------------------------------------
1 |
illustration/stackalt
--------------------------------------------------------------------------------
/src/stories/Page.svelte:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
24 |
25 |
26 | Pages in Storybook
27 |
28 | We recommend building UIs with a
29 |
33 | component-driven
34 |
35 | process starting with atomic components and ending with pages.
36 |
37 |
38 | Render pages with mock data. This makes it easy to build and review page states without
39 | needing to navigate to them in your app. Here are some handy patterns for managing page data
40 | in Storybook:
41 |
42 |
43 |
44 | Use a higher-level connected component. Storybook helps you compose such data from the
45 | "args" of child component stories
46 |
47 |
48 | Assemble data in the page component from your services. You can mock these services out
49 | using Storybook.
50 |
51 |
52 |
53 | Get a guided tutorial on component-driven development at
54 |
55 | Storybook tutorials
56 |
57 | . Read more in the
58 | docs
59 | .
60 |
61 |
62 |
Tip
63 | Adjust the width of the canvas with the
64 |
65 |
66 |
72 |
73 |
74 | Viewports addon in the toolbar
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/src/stories/Introduction.stories.mdx:
--------------------------------------------------------------------------------
1 | import { Meta } from '@storybook/addon-docs/blocks';
2 | import Code from './assets/code-brackets.svg';
3 | import Colors from './assets/colors.svg';
4 | import Comments from './assets/comments.svg';
5 | import Direction from './assets/direction.svg';
6 | import Flow from './assets/flow.svg';
7 | import Plugin from './assets/plugin.svg';
8 | import Repo from './assets/repo.svg';
9 | import StackAlt from './assets/stackalt.svg';
10 |
11 |
12 |
13 |
116 |
117 | # Welcome to Storybook
118 |
119 | Storybook helps you build UI components in isolation from your app's business logic, data, and context.
120 | That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
121 |
122 | Browse example stories now by navigating to them in the sidebar.
123 | View their code in the `src/stories` directory to learn how they work.
124 | We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
125 |
126 |
Configure
127 |
128 |
174 |
175 |
Learn
176 |
177 |
207 |
208 |
209 | Tip Edit the Markdown in{' '}
210 | src/stories/Introduction.stories.mdx
211 |
212 |
--------------------------------------------------------------------------------
/src/stories/assets/colors.svg:
--------------------------------------------------------------------------------
1 |
illustration/colors
--------------------------------------------------------------------------------