Updating to Svelte Vite + Tailwind 3 + Storybook 7

pull/32/head
Jerric Lyns John 1 year ago
parent b2e4ce08bb
commit 052cb6f1c2
  1. 2
      .editorconfig
  2. 21
      .eslintignore
  3. 22
      .eslintrc.cjs
  4. 26
      .eslintrc.js
  5. 37
      .github/workflows/nodejs.yml
  6. 26
      .gitignore
  7. 1
      .npmrc
  8. 3
      .out/0.47e7f5d9.iframe.bundle.js
  9. 17
      .out/0.47e7f5d9.iframe.bundle.js.LICENSE.txt
  10. 1
      .out/0.47e7f5d9.iframe.bundle.js.map
  11. 1
      .out/0.d22688a723a4fcd299c2.manager.bundle.js
  12. 3
      .out/1.a1654884.iframe.bundle.js
  13. 8
      .out/1.a1654884.iframe.bundle.js.LICENSE.txt
  14. 1
      .out/1.a1654884.iframe.bundle.js.map
  15. 3
      .out/10.bd76e6ec.iframe.bundle.js
  16. 12
      .out/10.bd76e6ec.iframe.bundle.js.LICENSE.txt
  17. 1
      .out/10.bd76e6ec.iframe.bundle.js.map
  18. 1
      .out/11.1daec09a.iframe.bundle.js
  19. 1
      .out/2.b59bb7f4.iframe.bundle.js
  20. 1
      .out/3.8bb2173c.iframe.bundle.js
  21. 2
      .out/4.0f335e2ab2ab47afdc0f.manager.bundle.js
  22. 8
      .out/4.0f335e2ab2ab47afdc0f.manager.bundle.js.LICENSE.txt
  23. 1
      .out/5.b49a176b296046658b2d.manager.bundle.js
  24. 2
      .out/6.4b100d5016535d0b17b5.manager.bundle.js
  25. 12
      .out/6.4b100d5016535d0b17b5.manager.bundle.js.LICENSE.txt
  26. 3
      .out/7.c057e38f.iframe.bundle.js
  27. 22
      .out/7.c057e38f.iframe.bundle.js.LICENSE.txt
  28. 1
      .out/7.c057e38f.iframe.bundle.js.map
  29. 1
      .out/7.cc463686747700bcc4d7.manager.bundle.js
  30. 1
      .out/8.0be70068b1a270e242c0.manager.bundle.js
  31. 1
      .out/8.779e82fa.iframe.bundle.js
  32. 1
      .out/9.402e74db.iframe.bundle.js
  33. BIN
      .out/favicon.ico
  34. 348
      .out/iframe.html
  35. 59
      .out/index.html
  36. 1
      .out/main.21241586911419940a10.manager.bundle.js
  37. 1
      .out/main.54767de6.iframe.bundle.js
  38. 1
      .out/runtime~main.9b079a98149130f1953b.manager.bundle.js
  39. 1
      .out/runtime~main.f78042e4.iframe.bundle.js
  40. 1
      .out/static/media/code-brackets.2e1112d7.svg
  41. 1
      .out/static/media/colors.a4bd0486.svg
  42. 1
      .out/static/media/comments.a3859089.svg
  43. 1
      .out/static/media/direction.b770f9af.svg
  44. 1
      .out/static/media/flow.edad2ac1.svg
  45. 1
      .out/static/media/plugin.d494b228.svg
  46. 1
      .out/static/media/repo.6d496322.svg
  47. 1
      .out/static/media/stackalt.dba9fbb3.svg
  48. 7
      .out/vendors~main.1b3bf76f.iframe.bundle.js
  49. 57
      .out/vendors~main.1b3bf76f.iframe.bundle.js.LICENSE.txt
  50. 1
      .out/vendors~main.1b3bf76f.iframe.bundle.js.map
  51. 2
      .out/vendors~main.3ba8f7fb4f290c3ad699.manager.bundle.js
  52. 104
      .out/vendors~main.3ba8f7fb4f290c3ad699.manager.bundle.js.LICENSE.txt
  53. 16
      .prettierignore
  54. 35
      .prettierrc
  55. 34
      .prettierrc.js
  56. 10
      .storybook/CustomTheme.js
  57. 32
      .storybook/main.js
  58. 1
      .storybook/manager-header.html
  59. 6
      .storybook/manager.js
  60. 6
      .storybook/preview-head.html
  61. 5
      .storybook/preview.js
  62. 11
      .vscode/extensions.json
  63. 4
      .vscode/settings.json
  64. 414
      README.md
  65. BIN
      assets/Storybook-alert-modern.PNG
  66. BIN
      assets/starter-template.jpg
  67. BIN
      assets/storybook-Documentation-Component.PNG
  68. BIN
      assets/storybook-accessibility-addon-colorblindness-emulation.PNG
  69. BIN
      assets/storybook-accessibility-addon.PNG
  70. BIN
      assets/storybook-actions-addon.PNG
  71. BIN
      assets/storybook-storycode-addon.PNG
  72. BIN
      assets/storybook-ui.PNG
  73. BIN
      assets/storybook-viewport-addon.PNG
  74. 20
      index.html
  75. 33
      jsconfig.json
  76. 51532
      package-lock.json
  77. 85
      package.json
  78. 6
      postcss.config.cjs
  79. 6
      postcss.config.js
  80. BIN
      public/favicon.png
  81. 5
      public/favicon.svg
  82. 16
      public/index.html
  83. 78
      rollup.config.js
  84. 11
      src/App.svelte
  85. 40
      src/assets/logo.svg
  86. BIN
      src/assets/social.jpg
  87. 51
      src/assets/window.svg
  88. 19
      src/components/Button.svelte
  89. 55
      src/components/nav.svelte
  90. 5
      src/favicon.svg
  91. 0
      src/index.css
  92. 32
      src/lib/atoms/Button.stories.svelte
  93. 35
      src/lib/atoms/Button.svelte
  94. 12
      src/lib/atoms/H1.stories.svelte
  95. 1
      src/lib/atoms/H1.svelte
  96. 26
      src/lib/atoms/Icon.stories.svelte
  97. 68
      src/lib/atoms/Icon.svelte
  98. 12
      src/lib/atoms/Pill.stories.svelte
  99. 4
      src/lib/atoms/Pill.svelte
  100. 108
      src/lib/introduction.mdx
  101. Some files were not shown because too many files have changed in this diff Show More

@ -6,4 +6,4 @@ indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
trim_trailing_whitespace = true

@ -1,11 +1,12 @@
/public/build/**
/storybook-static/**
/.out/**
/node_modules/**
package-lock.json
.DS_Store
node_modules/
.env
.env.*
!.env.example
dist
storybook-static
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
yarn-lock.json
.editorconfig
.eslintignore
.prettierignore
.gitignore
package-lock.json
yarn.lock

@ -0,0 +1,22 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier', 'plugin:json/recommended', 'plugin:storybook/recommended', 'plugin:storybook/recommended'],
plugins: ['svelte3', 'html'],
ignorePatterns: ['*.cjs'],
overrides: [{
files: ['*.svelte'],
processor: 'svelte3/svelte3'
}],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
},
rules: {
'json/*': ['error', 'allowComments']
}
};

@ -1,26 +0,0 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module'
},
env: {
es6: true,
browser: true,
node: true
},
plugins: ['svelte3'],
overrides: [
{
files: ['*.svelte'],
processor: 'svelte3/svelte3'
}
],
extends: ['eslint:recommended', 'prettier', 'plugin:json/recommended'],
rules: {
'json/*': ['error', 'allowComments']
},
settings: {
// ...
}
};

@ -3,24 +3,23 @@ name: Node CI
on: [push]
jobs:
build:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run build-stories --if-present
env:
CI: true
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run build-storybook --if-present
env:
CI: true

26
.gitignore vendored

@ -1,5 +1,25 @@
/node_modules/
/public/build/
/storybook-static/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
storybook-static
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -0,0 +1 @@
legacy-peer-deps=true

File diff suppressed because one or more lines are too long

@ -1,17 +0,0 @@
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

@ -1 +0,0 @@
{"version":3,"file":"0.47e7f5d9.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,8 +0,0 @@
/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/

@ -1 +0,0 @@
{"version":3,"file":"1.a1654884.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""}

File diff suppressed because one or more lines are too long

@ -1,12 +0,0 @@
/*!
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.13.0
*
* Copyright KingSora | Rene Haas.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 02.08.2020
*/

@ -1 +0,0 @@
{"version":3,"file":"10.bd76e6ec.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{"./node_modules/@storybook/preview-web/dist/esm/renderDocs.js":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"renderDocs",(function(){return renderDocs})),__webpack_require__.d(__webpack_exports__,"unmountDocs",(function(){return unmountDocs}));__webpack_require__("./node_modules/regenerator-runtime/runtime.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js");var react=__webpack_require__("./node_modules/react/index.js"),react_default=__webpack_require__.n(react),react_dom=__webpack_require__("./node_modules/react-dom/index.js"),react_dom_default=__webpack_require__.n(react_dom),wrapper={fontSize:"14px",letterSpacing:"0.2px",margin:"10px 0"},main={margin:"auto",padding:30,borderRadius:10,background:"rgba(0,0,0,0.03)"},heading={textAlign:"center"},NoDocs_NoDocs=function NoDocs(){return react_default.a.createElement("div",{style:wrapper,className:"sb-nodocs sb-wrapper"},react_default.a.createElement("div",{style:main},react_default.a.createElement("h1",{style:heading},"No Docs"),react_default.a.createElement("p",null,"Sorry, but there are no docs for the selected story. To add them, set the story's ",react_default.a.createElement("code",null,"docs")," parameter. If you think this is an error:"),react_default.a.createElement("ul",null,react_default.a.createElement("li",null,"Please check the story definition."),react_default.a.createElement("li",null,"Please check the Storybook config."),react_default.a.createElement("li",null,"Try reloading the page.")),react_default.a.createElement("p",null,"If the problem persists, check the browser console, or the terminal you've run Storybook from.")))};function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function renderDocs(story,docsContext,element,callback){return function renderDocsAsync(_x,_x2,_x3){return _renderDocsAsync.apply(this,arguments)}(story,docsContext,element).then(callback)}function _renderDocsAsync(){return(_renderDocsAsync=_asyncToGenerator(regeneratorRuntime.mark((function _callee(story,docsContext,element){var _docs$getContainer,_docs$getPage,docs,DocsContainer,Page,docsElement;return regeneratorRuntime.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(!(null!=(docs=story.parameters.docs)&&docs.getPage||null!=docs&&docs.page)||(null!=docs&&docs.getContainer||null!=docs&&docs.container)){_context.next=3;break}throw new Error("No `docs.container` set, did you run `addon-docs/preset`?");case 3:if(_context.t1=docs.container,_context.t1){_context.next=8;break}return _context.next=7,null===(_docs$getContainer=docs.getContainer)||void 0===_docs$getContainer?void 0:_docs$getContainer.call(docs);case 7:_context.t1=_context.sent;case 8:if(_context.t0=_context.t1,_context.t0){_context.next=11;break}_context.t0=function(_ref){var children=_ref.children;return react_default.a.createElement(react_default.a.Fragment,null,children)};case 11:if(DocsContainer=_context.t0,_context.t3=docs.page,_context.t3){_context.next=17;break}return _context.next=16,null===(_docs$getPage=docs.getPage)||void 0===_docs$getPage?void 0:_docs$getPage.call(docs);case 16:_context.t3=_context.sent;case 17:if(_context.t2=_context.t3,_context.t2){_context.next=20;break}_context.t2=NoDocs_NoDocs;case 20:return Page=_context.t2,docsElement=react_default.a.createElement(DocsContainer,{key:story.componentId,context:docsContext},react_default.a.createElement(Page,null)),_context.next=24,new Promise((function(resolve){react_dom_default.a.render(docsElement,element,resolve)}));case 24:case"end":return _context.stop()}}),_callee)})))).apply(this,arguments)}function unmountDocs(element){react_dom_default.a.unmountComponentAtNode(element)}NoDocs_NoDocs.displayName="NoDocs"}}]);

File diff suppressed because one or more lines are too long

@ -1,8 +0,0 @@
/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,12 +0,0 @@
/*!
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.13.0
*
* Copyright KingSora | Rene Haas.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 02.08.2020
*/

File diff suppressed because one or more lines are too long

@ -1,22 +0,0 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
/*! axe v4.3.5
* Copyright (c) 2021 Deque Systems, Inc.
*
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This entire copyright notice must appear in every copy of this file you
* distribute or in any file that contains substantial portions of this source
* code.
*/
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

@ -1 +0,0 @@
{"version":3,"file":"7.c057e38f.iframe.bundle.js","sources":[],"mappings":";A","sourceRoot":""}

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{964:function(module,exports){module.exports=function(e,n){return n=n||{},new Promise((function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t})),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)}))}}}]);

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],[,,function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){}]]);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

@ -1,348 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><base target="_parent"><style>:not(.sb-show-preparing-story) > .sb-preparing-story,
:not(.sb-show-preparing-docs) > .sb-preparing-docs,
:not(.sb-show-nopreview) > .sb-nopreview,
:not(.sb-show-errordisplay) > .sb-errordisplay {
display: none;
}
.sb-show-main.sb-main-centered {
margin: 0;
display: flex;
align-items: center;
min-height: 100vh;
}
.sb-show-main.sb-main-centered #root {
box-sizing: border-box;
margin: auto;
padding: 1rem;
max-height: 100%; /* Hack for centering correctly in IE11 */
}
/* Vertical centering fix for IE11 */
@media screen and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.sb-show-main.sb-main-centered:after {
content: '';
min-height: inherit;
font-size: 0;
}
}
.sb-show-main.sb-main-fullscreen {
margin: 0;
padding: 0;
display: block;
}
.sb-show-main.sb-main-padded {
margin: 0;
padding: 1rem;
display: block;
box-sizing: border-box;
}
.sb-wrapper {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
padding: 20px;
font-family: 'Nunito Sans', -apple-system, '.SFNSText-Regular', 'San Francisco',
BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
overflow: auto;
}
.sb-heading {
font-size: 14px;
font-weight: 600;
letter-spacing: 0.2px;
margin: 10px 0;
padding-right: 25px;
}
.sb-nopreview {
display: flex;
align-content: center;
justify-content: center;
}
.sb-nopreview_main {
margin: auto;
padding: 30px;
border-radius: 10px;
background: rgba(0, 0, 0, 0.03);
}
.sb-nopreview_heading {
text-align: center;
}
.sb-errordisplay {
border: 20px solid rgb(187, 49, 49);
background: #222;
color: #fff;
z-index: 999999;
}
.sb-errordisplay_code {
padding: 10px;
background: #000;
color: #eee;
font-family: 'Operator Mono', 'Fira Code Retina', 'Fira Code', 'FiraCode-Retina', 'Andale Mono',
'Lucida Console', Consolas, Monaco, monospace;
}
.sb-errordisplay pre {
white-space: pre-wrap;
}
@-webkit-keyframes sb-rotate360 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes sb-rotate360 {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@-webkit-keyframes sb-glow {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.4;
}
}
@keyframes sb-glow {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.4;
}
}
/* We display the preparing loaders *over* the rendering story */
.sb-preparing-story,
.sb-preparing-docs {
background-color: white;
}
.sb-loader {
-webkit-animation: sb-rotate360 0.7s linear infinite;
animation: sb-rotate360 0.7s linear infinite;
border-color: rgba(97, 97, 97, 0.29);
border-radius: 50%;
border-style: solid;
border-top-color: #646464;
border-width: 2px;
display: inline-block;
height: 32px;
left: 50%;
margin-left: -16px;
margin-top: -16px;
mix-blend-mode: difference;
overflow: hidden;
position: absolute;
top: 50%;
transition: all 200ms ease-out;
vertical-align: top;
width: 32px;
z-index: 4;
}
.sb-previewBlock {
background: #fff;
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 3px 0;
margin: 25px auto 40px;
max-width: 600px;
}
.sb-previewBlock_header {
align-items: center;
box-shadow: rgba(0, 0, 0, 0.1) 0 -1px 0 0 inset;
display: flex;
gap: 14px;
height: 40px;
padding: 0 12px;
}
.sb-previewBlock_icon {
-webkit-animation: sb-glow 1.5s ease-in-out infinite;
animation: sb-glow 1.5s ease-in-out infinite;
background: #e6e6e6;
height: 14px;
width: 14px;
}
.sb-previewBlock_icon:last-child {
margin-left: auto;
}
.sb-previewBlock_body {
-webkit-animation: sb-glow 1.5s ease-in-out infinite;
animation: sb-glow 1.5s ease-in-out infinite;
height: 182px;
position: relative;
}
.sb-argstableBlock {
border-collapse: collapse;
border-spacing: 0;
font-size: 13px;
line-height: 20px;
margin: 25px auto 40px;
max-width: 600px;
text-align: left;
width: 100%;
}
.sb-argstableBlock th:first-of-type,
.sb-argstableBlock td:first-of-type {
padding-left: 20px;
}
.sb-argstableBlock th:nth-of-type(2),
.sb-argstableBlock td:nth-of-type(2) {
width: 35%;
}
.sb-argstableBlock th:nth-of-type(3),
.sb-argstableBlock td:nth-of-type(3) {
width: 15%;
}
.sb-argstableBlock th:laste-of-type,
.sb-argstableBlock td:laste-of-type {
width: 25%;
padding-right: 20px;
}
.sb-argstableBlock th span,
.sb-argstableBlock td span {
-webkit-animation: sb-glow 1.5s ease-in-out infinite;
animation: sb-glow 1.5s ease-in-out infinite;
background-color: rgba(0, 0, 0, 0.1);
border-radius: 0;
box-shadow: none;
color: transparent;
}
.sb-argstableBlock th {
padding: 10px 15px;
}
.sb-argstableBlock-body {
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 3px 1px, rgba(0, 0, 0, 0.065) 0 0 0 1px;
}
.sb-argstableBlock-body tr {
background: transparent;
overflow: hidden;
}
.sb-argstableBlock-body tr:not(:first-child) {
border-top: 1px solid #e6e6e6;
}
.sb-argstableBlock-body tr:first-child td:first-child {
border-top-left-radius: 4px;
}
.sb-argstableBlock-body tr:first-child td:last-child {
border-top-right-radius: 4px;
}
.sb-argstableBlock-body tr:last-child td:first-child {
border-bottom-left-radius: 4px;
}
.sb-argstableBlock-body tr:last-child td:last-child {
border-bottom-right-radius: 4px;
}
.sb-argstableBlock-body td {
background: #fff;
padding-bottom: 10px;
padding-top: 10px;
vertical-align: top;
}
.sb-argstableBlock-body td:not(:first-of-type) {
padding-left: 15px;
padding-right: 15px;
}
.sb-argstableBlock-body button {
-webkit-animation: sb-glow 1.5s ease-in-out infinite;
animation: sb-glow 1.5s ease-in-out infinite;
background-color: rgba(0, 0, 0, 0.1);
border: 0;
border-radius: 0;
box-shadow: none;
color: transparent;
display: inline;
font-size: 12px;
line-height: 1;
padding: 10px 16px;
}
.sb-argstableBlock-summary {
margin-top: 4px;
}
.sb-argstableBlock-code {
margin-right: 4px;
margin-bottom: 4px;
padding: 2px 5px;
}</style><script>/* globals window */
/* eslint-disable no-underscore-dangle */
try {
if (window.top !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.top.__VUE_DEVTOOLS_GLOBAL_HOOK__;
window.top.__VUE_DEVTOOLS_CONTEXT__ = window.document;
}
} catch (e) {
// eslint-disable-next-line no-console
console.warn('unable to connect to top frame for connecting dev tools');
}
window.onerror = function onerror(message, source, line, column, err) {
if (window.CONFIG_TYPE !== 'DEVELOPMENT') return;
// eslint-disable-next-line no-var, vars-on-top
var xhr = new window.XMLHttpRequest();
xhr.open('POST', '/runtime-error');
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xhr.send(
JSON.stringify({
/* eslint-disable object-shorthand */
message: message,
source: source,
line: line,
column: column,
error: err && { message: err.message, name: err.name, stack: err.stack },
origin: 'preview',
/* eslint-enable object-shorthand */
})
);
};</script><style>#root[hidden],
#docs-root[hidden] {
display: none !important;
}</style></head><body><div class="sb-preparing-story sb-wrapper"><div class="sb-loader"></div></div><div class="sb-preparing-docs sb-wrapper"><div class="sb-previewBlock"><div class="sb-previewBlock_header"><div class="sb-previewBlock_icon"></div><div class="sb-previewBlock_icon"></div><div class="sb-previewBlock_icon"></div><div class="sb-previewBlock_icon"></div></div><div class="sb-previewBlock_body"><div class="sb-loader"></div></div></div><table aria-hidden="true" class="sb-argstableBlock"><thead class="sb-argstableBlock-head"><tr><th><span>Name</span></th><th><span>Description</span></th><th><span>Default</span></th><th><span>Control</span></th></tr></thead><tbody class="sb-argstableBlock-body"><tr><td><span>propertyName</span><span title="Required">*</span></td><td><div><span>This is a short description</span></div><div class="sb-argstableBlock-summary"><div><span class="sb-argstableBlock-code">summary</span></div></div></td><td><div><span class="sb-argstableBlock-code">defaultValue</span></div></td><td><button>Set string</button></td></tr><tr><td><span>propertyName</span><span>*</span></td><td><div><span>This is a short description</span></div><div class="sb-argstableBlock-summary"><div><span class="sb-argstableBlock-code">summary</span></div></div></td><td><div><span class="sb-argstableBlock-code">defaultValue</span></div></td><td><button>Set string</button></td></tr><tr><td><span>propertyName</span><span>*</span></td><td><div><span>This is a short description</span></div><div class="sb-argstableBlock-summary"><div><span class="sb-argstableBlock-code">summary</span></div></div></td><td><div><span class="sb-argstableBlock-code">defaultValue</span></div></td><td><button>Set string</button></td></tr></tbody></table></div><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script>window['CONFIG_TYPE'] = "PRODUCTION";
window['LOGLEVEL'] = "info";
window['FRAMEWORK_OPTIONS'] = {"preprocess":{"defaultLanguages":{"markup":"html","style":"css","script":"javascript"},"filename":"/Users/jerric/CodeBase/TestBase/jerriclynsjohn/svelte-storybook-tailwind/node_modules/@storybook/addon-docs/dist/esm/frameworks/svelte/HOC.svelte"}};
window['FEATURES'] = {"postcss":true,"emotionAlias":true,"warnOnLegacyHierarchySeparator":true};
window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx|svelte)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx|svelte))$"}];</script><script src="runtime~main.f78042e4.iframe.bundle.js"></script><script src="vendors~main.1b3bf76f.iframe.bundle.js"></script><script src="main.54767de6.iframe.bundle.js"></script></body></html>

@ -1,59 +0,0 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"/><style>html, body {
overflow: hidden;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}</style><script>/* globals window */
/* eslint-disable no-underscore-dangle */
try {
if (window.top !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
}
} catch (e) {
// eslint-disable-next-line no-console
console.warn('unable to connect to top frame for connecting dev tools');
}
window.onerror = function onerror(message, source, line, column, err) {
if (window.CONFIG_TYPE !== 'DEVELOPMENT') return;
// eslint-disable-next-line no-var, vars-on-top
var xhr = new window.XMLHttpRequest();
xhr.open('POST', '/runtime-error');
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xhr.send(
JSON.stringify({
/* eslint-disable object-shorthand */
message: message,
source: source,
line: line,
column: column,
error: err && { message: err.message, name: err.name, stack: err.stack },
origin: 'manager',
/* eslint-enable object-shorthand */
})
);
};</script><style>#root[hidden],
#docs-root[hidden] {
display: none !important;
}</style></head><body><div id="root"></div><div id="docs-root"></div><script>window['CONFIG_TYPE'] = "PRODUCTION";
window['LOGLEVEL'] = "info";
window['FEATURES'] = {"postcss":true,"emotionAlias":true,"warnOnLegacyHierarchySeparator":true};
window['DOCS_MODE'] = false;</script><script src="runtime~main.9b079a98149130f1953b.manager.bundle.js"></script><script src="vendors~main.3ba8f7fb4f290c3ad699.manager.bundle.js"></script><script src="main.21241586911419940a10.manager.bundle.js"></script></body></html>

@ -1 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{488:function(module,exports,__webpack_require__){__webpack_require__(489),__webpack_require__(879),__webpack_require__(888),__webpack_require__(889),__webpack_require__(880),__webpack_require__(884),__webpack_require__(883),__webpack_require__(885),__webpack_require__(882),__webpack_require__(886),__webpack_require__(887),__webpack_require__(875),__webpack_require__(890),module.exports=__webpack_require__(881)},555:function(module,exports){}},[[488,2,3]]]);

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
!function(modules){function webpackJsonpCallback(data){for(var moduleId,chunkId,chunkIds=data[0],moreModules=data[1],executeModules=data[2],i=0,resolves=[];i<chunkIds.length;i++)chunkId=chunkIds[i],Object.prototype.hasOwnProperty.call(installedChunks,chunkId)&&installedChunks[chunkId]&&resolves.push(installedChunks[chunkId][0]),installedChunks[chunkId]=0;for(moduleId in moreModules)Object.prototype.hasOwnProperty.call(moreModules,moduleId)&&(modules[moduleId]=moreModules[moduleId]);for(parentJsonpFunction&&parentJsonpFunction(data);resolves.length;)resolves.shift()();return deferredModules.push.apply(deferredModules,executeModules||[]),checkDeferredModules()}function checkDeferredModules(){for(var result,i=0;i<deferredModules.length;i++){for(var deferredModule=deferredModules[i],fulfilled=!0,j=1;j<deferredModule.length;j++){var depId=deferredModule[j];0!==installedChunks[depId]&&(fulfilled=!1)}fulfilled&&(deferredModules.splice(i--,1),result=__webpack_require__(__webpack_require__.s=deferredModule[0]))}return result}var installedModules={},installedChunks={2:0},deferredModules=[];function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}__webpack_require__.e=function requireEnsure(chunkId){var promises=[],installedChunkData=installedChunks[chunkId];if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else{var promise=new Promise((function(resolve,reject){installedChunkData=installedChunks[chunkId]=[resolve,reject]}));promises.push(installedChunkData[2]=promise);var onScriptComplete,script=document.createElement("script");script.charset="utf-8",script.timeout=120,__webpack_require__.nc&&script.setAttribute("nonce",__webpack_require__.nc),script.src=function jsonpScriptSrc(chunkId){return __webpack_require__.p+""+({}[chunkId]||chunkId)+"."+{0:"d22688a723a4fcd299c2",4:"0f335e2ab2ab47afdc0f",5:"b49a176b296046658b2d",6:"4b100d5016535d0b17b5",7:"cc463686747700bcc4d7",8:"0be70068b1a270e242c0"}[chunkId]+".manager.bundle.js"}(chunkId);var error=new Error;onScriptComplete=function(event){script.onerror=script.onload=null,clearTimeout(timeout);var chunk=installedChunks[chunkId];if(0!==chunk){if(chunk){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,chunk[1](error)}installedChunks[chunkId]=void 0}};var timeout=setTimeout((function(){onScriptComplete({type:"timeout",target:script})}),12e4);script.onerror=script.onload=onScriptComplete,document.head.appendChild(script)}return Promise.all(promises)},__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__.oe=function(err){throw console.error(err),err};var jsonpArray=window.webpackJsonp=window.webpackJsonp||[],oldJsonpFunction=jsonpArray.push.bind(jsonpArray);jsonpArray.push=webpackJsonpCallback,jsonpArray=jsonpArray.slice();for(var i=0;i<jsonpArray.length;i++)webpackJsonpCallback(jsonpArray[i]);var parentJsonpFunction=oldJsonpFunction;checkDeferredModules()}([]);

@ -1 +0,0 @@
!function(modules){function webpackJsonpCallback(data){for(var moduleId,chunkId,chunkIds=data[0],moreModules=data[1],executeModules=data[2],i=0,resolves=[];i<chunkIds.length;i++)chunkId=chunkIds[i],Object.prototype.hasOwnProperty.call(installedChunks,chunkId)&&installedChunks[chunkId]&&resolves.push(installedChunks[chunkId][0]),installedChunks[chunkId]=0;for(moduleId in moreModules)Object.prototype.hasOwnProperty.call(moreModules,moduleId)&&(modules[moduleId]=moreModules[moduleId]);for(parentJsonpFunction&&parentJsonpFunction(data);resolves.length;)resolves.shift()();return deferredModules.push.apply(deferredModules,executeModules||[]),checkDeferredModules()}function checkDeferredModules(){for(var result,i=0;i<deferredModules.length;i++){for(var deferredModule=deferredModules[i],fulfilled=!0,j=1;j<deferredModule.length;j++){var depId=deferredModule[j];0!==installedChunks[depId]&&(fulfilled=!1)}fulfilled&&(deferredModules.splice(i--,1),result=__webpack_require__(__webpack_require__.s=deferredModule[0]))}return result}var installedModules={},installedChunks={5:0},deferredModules=[];function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}__webpack_require__.e=function requireEnsure(chunkId){var promises=[],installedChunkData=installedChunks[chunkId];if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else{var promise=new Promise((function(resolve,reject){installedChunkData=installedChunks[chunkId]=[resolve,reject]}));promises.push(installedChunkData[2]=promise);var onScriptComplete,script=document.createElement("script");script.charset="utf-8",script.timeout=120,__webpack_require__.nc&&script.setAttribute("nonce",__webpack_require__.nc),script.src=function jsonpScriptSrc(chunkId){return __webpack_require__.p+""+({}[chunkId]||chunkId)+"."+{0:"47e7f5d9",1:"a1654884",2:"b59bb7f4",3:"8bb2173c",7:"c057e38f",8:"779e82fa",9:"402e74db",10:"bd76e6ec",11:"1daec09a"}[chunkId]+".iframe.bundle.js"}(chunkId);var error=new Error;onScriptComplete=function(event){script.onerror=script.onload=null,clearTimeout(timeout);var chunk=installedChunks[chunkId];if(0!==chunk){if(chunk){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,chunk[1](error)}installedChunks[chunkId]=void 0}};var timeout=setTimeout((function(){onScriptComplete({type:"timeout",target:script})}),12e4);script.onerror=script.onload=onScriptComplete,document.head.appendChild(script)}return Promise.all(promises)},__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__.oe=function(err){throw console.error(err),err};var jsonpArray=window.webpackJsonp=window.webpackJsonp||[],oldJsonpFunction=jsonpArray.push.bind(jsonpArray);jsonpArray.push=webpackJsonpCallback,jsonpArray=jsonpArray.slice();for(var i=0;i<jsonpArray.length;i++)webpackJsonpCallback(jsonpArray[i]);var parentJsonpFunction=oldJsonpFunction;checkDeferredModules()}([]);

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/code-brackets</title><g id="illustration/code-brackets" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Combined-Shape" fill="#87E6E5" d="M11.4139325,12 C11.7605938,12 12,12.5059743 12,13.3779712 L12,17.4951758 L6.43502246,23.3839989 C5.85499251,23.9978337 5.85499251,25.0021663 6.43502246,25.6160011 L12,31.5048242 L12,35.6220288 C12,36.4939606 11.7605228,37 11.4139325,37 C11.2725831,37 11.1134406,36.9158987 10.9453839,36.7379973 L0.435022463,25.6160011 C-0.145007488,25.0021663 -0.145007488,23.9978337 0.435022463,23.3839989 L10.9453839,12.2620027 C11.1134051,12.0841663 11.2725831,12 11.4139325,12 Z M36.5860675,12 C36.7274169,12 36.8865594,12.0841013 37.0546161,12.2620027 L47.5649775,23.3839989 C48.1450075,23.9978337 48.1450075,25.0021663 47.5649775,25.6160011 L37.0546161,36.7379973 C36.8865949,36.9158337 36.7274169,37 36.5860675,37 C36.2394062,37 36,36.4940257 36,35.6220288 L36,31.5048242 L41.5649775,25.6160011 C42.1450075,25.0021663 42.1450075,23.9978337 41.5649775,23.3839989 L36,17.4951758 L36,13.3779712 C36,12.5060394 36.2394772,12 36.5860675,12 Z"/><rect id="Rectangle-7-Copy-5" width="35.57" height="4" x="5.009" y="22.662" fill="#A0DB77" rx="2" transform="translate(22.793959, 24.662305) rotate(-75.000000) translate(-22.793959, -24.662305)"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.3 KiB

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/comments</title><g id="illustration/comments" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Path" fill="#96D07C" d="M2.52730803,17.9196415 C2.44329744,17.9745167 2.36370847,18.000488 2.29303375,18.000488 C2.1197031,18.000488 2,17.8443588 2,17.5752855 L2,4 C2,1.790861 3.790861,3.23296945e-13 6,3.23296945e-13 L33.9995117,3.23296945e-13 C36.2086507,3.23296945e-13 37.9995117,1.790861 37.9995117,4 L37.9995117,9.999512 C37.9995117,12.208651 36.2086507,13.999512 33.9995117,13.999512 L8,13.999512 C7.83499225,13.999512 7.6723181,13.9895206 7.51254954,13.9701099 L2.52730803,17.9196415 Z"/><path id="Path" fill="#73E1E0" d="M7.51066,44.9703679 L2.52730803,47.9186655 C2.44329744,47.9735407 2.36370847,47.999512 2.29303375,47.999512 C2.1197031,47.999512 2,47.8433828 2,47.5743095 L2,35 C2,32.790861 3.790861,31 6,31 L26,31 C28.209139,31 30,32.790861 30,35 L30,41 C30,43.209139 28.209139,45 26,45 L8,45 C7.8343417,45 7.67103544,44.9899297 7.51066,44.9703679 Z"/><path id="Path" fill="#FFD476" d="M46,19.5 L46,33.0747975 C46,33.3438708 45.8802969,33.5 45.7069663,33.5 C45.6362915,33.5 45.5567026,33.4740287 45.472692,33.4191535 L40.4887103,29.4704446 C40.3285371,29.489956 40.1654415,29.5 40,29.5 L18,29.5 C15.790861,29.5 14,27.709139 14,25.5 L14,19.5 C14,17.290861 15.790861,15.5 18,15.5 L42,15.5 C44.209139,15.5 46,17.290861 46,19.5 Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/direction</title><g id="illustration/direction" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Combined-Shape" fill="#FFD476" d="M23.4917015,33.6030641 L2.93840258,31.4321033 C2.38917316,31.3740904 1.99096346,30.8818233 2.04897631,30.3325939 C2.0747515,30.0885705 2.18934861,29.8625419 2.37095722,29.6975265 L34.2609105,0.721285325 C34.6696614,0.349881049 35.3021022,0.38015648 35.6735064,0.788907393 C35.9232621,1.06377731 36.0001133,1.45442096 35.8730901,1.80341447 L24.5364357,32.9506164 C24.3793473,33.3822133 23.9484565,33.6513092 23.4917015,33.6030641 L23.4917015,33.6030641 Z"/><path id="Combined-Shape-Copy" fill="#FFC445" d="M24.3163597,33.2881029 C24.0306575,33.0138462 23.9337246,32.5968232 24.069176,32.2246735 L35.091923,1.9399251 C35.2266075,1.56988243 35.5659249,1.31333613 35.9586669,1.28460955 C36.5094802,1.24432106 36.9886628,1.65818318 37.0289513,2.20899647 L40.2437557,46.1609256 C40.2644355,46.4436546 40.1641446,46.7218752 39.9678293,46.9263833 C39.5853672,47.3248067 38.9523344,47.3377458 38.5539111,46.9552837 L24.3163597,33.2881029 L24.3163597,33.2881029 Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/flow</title><g id="illustration/flow" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Combined-Shape" fill="#79C9FC" fill-rule="nonzero" d="M30,29 C32.7614237,29 35,26.7614237 35,24 C35,14.6111593 27.3888407,7 18,7 C8.61115925,7 1,14.6111593 1,24 C1,33.3888407 8.61115925,41 18,41 C19.3333404,41 20.6447683,40.8466238 21.9154603,40.5471706 C19.5096374,39.3319645 17.5510566,37.8612875 16.0456579,36.1314815 C14.1063138,33.9030427 12.769443,31.0725999 12.0293806,27.6556449 C11.360469,26.565281 11,25.3082308 11,24 C11,20.1340068 14.1340068,17 18,17 C21.8659932,17 25,20.1340068 25,24 C25,26.125 27.7040312,29 30,29 Z"/><path id="Combined-Shape-Copy" fill="#FFC445" fill-rule="nonzero" d="M42,29 C44.7614237,29 47,26.7614237 47,24 C47,14.6111593 39.3888407,7 30,7 C20.6111593,7 13,14.6111593 13,24 C13,33.3888407 20.6111593,41 30,41 C31.3333404,41 32.6447683,40.8466238 33.9154603,40.5471706 C31.5096374,39.3319645 29.4051056,37.9781963 28.0456579,36.1314815 C26.0625,33.4375 23,27.1875 23,24 C23,20.1340068 26.1340068,17 30,17 C33.8659932,17 37,20.1340068 37,24 C37.02301,26.3435241 39.7040312,29 42,29 Z" transform="translate(30.000000, 24.000000) scale(-1, -1) translate(-30.000000, -24.000000)"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/plugin</title><g id="illustration/plugin" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Combined-Shape" fill="#79C9FC" d="M26,15.3994248 C26,15.4091303 26,15.4188459 26,15.4285714 L26,21.4694881 C25.8463595,21.4969567 25.6941676,21.51275 25.5873784,21.51275 C25.4974117,21.51275 25.4230979,21.4768034 25.377756,21.4206259 L25.2660784,21.2822603 L25.1317423,21.1657666 C24.2436317,20.3956144 23.100098,19.9633214 21.895551,19.9633214 C19.2039137,19.9633214 17,22.1075558 17,24.7804643 C17,27.4533728 19.2039137,29.5976071 21.895551,29.5976071 C23.1972122,29.5976071 24.3149423,29.2878193 25.1231445,28.3613697 C25.4542273,27.9818463 25.568273,27.9073214 25.5873784,27.9073214 C25.681532,27.9073214 25.8352452,27.9239643 26,27.9524591 L26,32.5714286 C26,32.5811541 26,32.5908697 26,32.6005752 L26,33 C26,35.209139 24.209139,37 22,37 L4,37 C1.790861,37 0,35.209139 0,33 L0,15 C0,12.790861 1.790861,11 4,11 L22,11 C24.209139,11 26,12.790861 26,15 L26,15.3994248 Z"/><path id="Path" fill="#87E6E5" d="M27.9998779,32.5714286 C27.9998779,33.3604068 28.6572726,34 29.4682101,34 L46.5315458,34 C47.3424832,34 47.9998779,33.3604068 47.9998779,32.5714286 L47.9998779,15.4285714 C47.9998779,14.6395932 47.3424832,14 46.5315458,14 L29.4682101,14 C28.6572726,14 27.9998779,14.6395932 27.9998779,15.4285714 L27.9998779,21.8355216 C27.9334367,22.2650514 27.8567585,22.6454496 27.746391,22.8084643 C27.4245309,23.2838571 26.2402709,23.51275 25.5873784,23.51275 C24.8705773,23.51275 24.2322714,23.1857725 23.8214379,22.6767605 C23.3096996,22.2329909 22.6349941,21.9633214 21.895551,21.9633214 C20.2963823,21.9633214 19,23.2245992 19,24.7804643 C19,26.3363293 20.2963823,27.5976071 21.895551,27.5976071 C22.5398535,27.5976071 23.2399343,27.477727 23.6160247,27.0466112 C24.1396029,26.4464286 24.7367044,25.9073214 25.5873784,25.9073214 C26.2402709,25.9073214 27.5912951,26.1766031 27.8226692,26.6116071 C27.8819199,26.7230038 27.9403239,26.921677 27.9998779,27.1556219 L27.9998779,32.5714286 Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/repo</title><g id="illustration/repo" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Rectangle-62-Copy" fill="#B7F0EF" d="M27.2217723,9.04506931 L41.2217723,6.2682098 C43.3886973,5.83840648 45.4937616,7.2466219 45.9235649,9.41354696 C45.9743993,9.66983721 46,9.93049166 46,10.1917747 L46,32.581381 C46,34.4904961 44.650862,36.1335143 42.7782277,36.5049459 L28.7782277,39.2818054 C26.6113027,39.7116087 24.5062384,38.3033933 24.0764351,36.1364682 C24.0256007,35.880178 24,35.6195235 24,35.3582405 L24,12.9686342 C24,11.0595191 25.349138,9.4165009 27.2217723,9.04506931 Z" opacity=".7"/><path id="Combined-Shape" fill="#87E6E5" d="M6.77822775,6.2682098 L20.7782277,9.04506931 C22.650862,9.4165009 24,11.0595191 24,12.9686342 L24,35.3582405 C24,37.5673795 22.209139,39.3582405 20,39.3582405 C19.738717,39.3582405 19.4780625,39.3326398 19.2217723,39.2818054 L5.22177225,36.5049459 C3.34913798,36.1335143 2,34.4904961 2,32.581381 L2,10.1917747 C2,7.98263571 3.790861,6.19177471 6,6.19177471 C6.26128305,6.19177471 6.5219375,6.21737537 6.77822775,6.2682098 Z"/><path id="Rectangle-63-Copy-2" fill="#61C1FD" d="M22,10 C23.1666667,10.2291667 24.0179036,10.625 24.5537109,11.1875 C25.0895182,11.75 25.5716146,12.875 26,14.5625 C26,29.3020833 26,37.5208333 26,39.21875 C26,40.9166667 26.4241536,42.9583333 27.2724609,45.34375 L24.5537109,41.875 L22.9824219,45.34375 C22.327474,43.1979167 22,41.2291667 22,39.4375 C22,37.6458333 22,27.8333333 22,10 Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" version="1.1" viewBox="0 0 48 48"><title>illustration/stackalt</title><g id="illustration/stackalt" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><path id="Combined-Shape" fill="#FFAE00" d="M23.8628277,0 L23.8628277,48 L3.32291648,36.2491883 L3.32155653,11.9499781 L23.8628277,0 Z M23.8670509,0 L44.408322,11.9499781 L44.4069621,36.2491883 L23.8670509,48 L23.8670509,0 Z" opacity=".196"/><path id="Rectangle-46-Copy-3" fill="#66BF3C" d="M15.8232279,19.1155258 L24.7368455,21.4714881 C29.6053842,22.7582937 33.4077423,26.5606518 34.694548,31.4291905 L37.0505103,40.3428082 C37.6150232,42.4786032 36.3412474,44.6676353 34.2054524,45.2321482 C33.5569474,45.4035549 32.87575,45.4091235 32.2245294,45.2483418 L23.3459013,43.0562718 C18.2976962,41.809906 14.3561301,37.8683399 13.1097642,32.8201348 L10.9176943,23.9415066 C10.3881737,21.7967682 11.6975664,19.6288529 13.8423049,19.0993322 C14.4935255,18.9385505 15.1747229,18.9441191 15.8232279,19.1155258 Z" opacity=".5" transform="translate(23.999997, 32.166058) rotate(-45.000000) translate(-23.999997, -32.166058)"/><path id="Rectangle-46-Copy-2" fill="#FFAE00" d="M15.8232279,11.2216893 L24.7368455,13.5776516 C29.6053842,14.8644572 33.4077423,18.6668153 34.694548,23.5353541 L37.0505103,32.4489717 C37.6150232,34.5847667 36.3412474,36.7737988 34.2054524,37.3383117 C33.5569474,37.5097184 32.87575,37.515287 32.2245294,37.3545053 L23.3459013,35.1624353 C18.2976962,33.9160695 14.3561301,29.9745034 13.1097642,24.9262983 L10.9176943,16.0476701 C10.3881737,13.9029317 11.6975664,11.7350164 13.8423049,11.2054957 C14.4935255,11.044714 15.1747229,11.0502826 15.8232279,11.2216893 Z" opacity=".5" transform="translate(23.999997, 24.272222) rotate(-45.000000) translate(-23.999997, -24.272222)"/><path id="Rectangle-46-Copy" fill="#FC521F" d="M15.8232279,3.32785281 L24.7368455,5.68381509 C29.6053842,6.97062075 33.4077423,10.7729788 34.694548,15.6415176 L37.0505103,24.5551352 C37.6150232,26.6909302 36.3412474,28.8799623 34.2054524,29.4444752 C33.5569474,29.6158819 32.87575,29.6214505 32.2245294,29.4606688 L23.3459013,27.2685988 C18.2976962,26.022233 14.3561301,22.0806669 13.1097642,17.0324618 L10.9176943,8.15383364 C10.3881737,6.00909519 11.6975664,3.84117987 13.8423049,3.31165925 C14.4935255,3.15087753 15.1747229,3.15644615 15.8232279,3.32785281 Z" opacity=".5" transform="translate(23.999997, 16.378385) rotate(-45.000000) translate(-23.999997, -16.378385)"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

File diff suppressed because one or more lines are too long

@ -1,57 +0,0 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2020 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
/*!
* https://github.com/paulmillr/es6-shim
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
* es6-shim: v0.35.4
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
//! stable.js 0.1.8, https://github.com/Two-Screen/stable
//! © 2018 Angry Bytes and contributors. MIT licensed.

@ -1 +0,0 @@
{"version":3,"file":"vendors~main.1b3bf76f.iframe.bundle.js","sources":[],"mappings":";;;;;A","sourceRoot":""}

File diff suppressed because one or more lines are too long

@ -1,104 +0,0 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
* Fuse.js v3.6.1 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2020 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
/*!
* https://github.com/paulmillr/es6-shim
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
* and contributors, MIT License
* es6-shim: v0.35.4
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
* Details and documentation:
* https://github.com/paulmillr/es6-shim/
*/
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
/**
* React Router DOM v6.2.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
/**
* React Router v6.2.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

@ -1,4 +1,12 @@
/storybook-static/**
/.out/**
/public/build/**
/node_modules/**
.DS_Store
node_modules
.env
.env.*
!.env.example
dist
storybook-static
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

@ -0,0 +1,35 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"bracketSameLine": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 80,
"svelteSortOrder": "options-scripts-markup-styles",
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"pluginSearchDirs": false,
"overrides": [
{
"files": "*.svelte",
"options": {"parser": "svelte", "printWidth": 100}
},
{
"files": [
"*.json",
"postcss.config.js",
"rollup.config.js",
"tailwind.config.js",
"stylelint.config.js"
],
"options": {
"printWidth": 150
}
},
{
"files": ["*.json"],
"options": {
"parser": "json"
}
}
]
}

@ -1,34 +0,0 @@
module.exports = {
arrowParens: 'avoid',
bracketSpacing: false,
singleQuote: true,
printWidth: 80,
svelteSortOrder: 'options-scripts-markup-styles',
trailingComma: 'none',
overrides: [
{
files: ['*.svelte', '*.html'],
options: {
printWidth: 120
}
},
{
files: [
'*.json',
'postcss.config.js',
'rollup.config.js',
'tailwind.config.js',
'stylelint.config.js'
],
options: {
printWidth: 150
}
},
{
files: ['*.json'],
options: {
parser: 'json'
}
}
]
};

@ -0,0 +1,10 @@
import {create} from '@storybook/theming';
export default create({
base: 'dark',
brandTitle: 'Svelte + Storybook + TailwindCSS',
brandUrl: 'https://svelte-storybook-tailwindcss.sveltehub.dev',
brandImage:
'https://sveltehub.dev/templates/storybook-tailwindcss/logo-white.png',
brandTarget: '_blank'
});

@ -1,26 +1,18 @@
module.exports = {
stories: [
'../src/**/*.stories.mdx',
'../src/**/*.stories.@(js|jsx|ts|tsx|svelte)'
],
/** @type { import('@storybook/svelte-vite').StorybookConfig } */
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx|svelte)'],
addons: [
'@storybook/addon-svelte-csf',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-svelte-csf',
'@storybook/addon-storysource',
'@storybook/addon-a11y',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
'@storybook/addon-interactions'
],
framework: '@storybook/svelte',
svelteOptions: {
preprocess: require('svelte-preprocess')({ postcss: true })
framework: {
name: '@storybook/svelte-vite',
options: {}
},
docs: {
autodocs: 'tag'
}
};
export default config;

@ -0,0 +1 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />

@ -0,0 +1,6 @@
import {addons} from '@storybook/addons';
import customTheme from './CustomTheme';
addons.setConfig({
theme: customTheme
});

@ -0,0 +1,6 @@
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;600;700&display=swap');
</style>
<script>
window.global = window;
</script>

@ -1,4 +1,9 @@
import '../src/index.css';
export const parameters = {
backgrounds: {
default: 'light'
},
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {

@ -1,9 +1,6 @@
{
"recommendations": [
"svelte.svelte-vscode",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"EditorConfig.EditorConfig",
"bradlc.vscode-tailwindcss"
]
"recommendations": ["svelte.svelte-vscode","dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"EditorConfig.EditorConfig",
"bradlc.vscode-tailwindcss"]
}

@ -4,6 +4,7 @@
"editor.codeActionsOnSave": {
"source.fixAll": false
},
"eslint.packageManager": "pnpm",
// For activating stylelint config
"css.validate": false,
"less.validate": false,
@ -15,5 +16,6 @@
// Svelte for VS Code
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
}
},
"cSpell.words": ["autodocs", "browserconfig", "favicons", "stylelint", "tailwindcss", "Typecheck"]
}

@ -1,10 +1,8 @@
[![Netlify Status](https://api.netlify.com/api/v1/badges/b4aa4a04-e097-4067-87ec-9a6681335673/deploy-status)](https://app.netlify.com/sites/svelte-tailwindcss-storybook/deploys) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind?ref=badge_shield)
# Svelte 3.5 + Storybook 7 + TailwindCSS 3
# A starter template for Svelte 3.46, TailwindCSS 3 and Storybook 6.4
![Svelte, Storybook & Tailwind](src/assets/social.jpg)
![Svelte + TailwindCSS + Storybook Starter Template](assets/starter-template.jpg)
> Visit this website to see the outcome: [Svelte + TailwindCSS + Storybook](https://svelte-tailwindcss-storybook.netlify.com)
Visit the website to see the outcome: [Svelte + Storybook + TailwindCSS](https://sst.sveltehub.dev)
```bash
// Quickstart
@ -12,390 +10,94 @@
npx degit jerriclynsjohn/svelte-storybook-tailwind my-svelte-project
cd my-svelte-project
yarn
yarn dev
yarn storybook
npm
npm run dev
npm run storybook
```
Svelte and TailwindCSS is an awesome combination for Frontend development, but sometimes the setup seems a bit non intuitive, especially when trying to try out this awesome combination. When integrating Storybook, which is another awesome tool for UI Component development and documentation, there is no obvious place to get how it's done. This repo was made to address just that!
This has improved a lot since I started this repo, but I feel that there is still a need to just clone the repo and kickstart the project, so here I am again updating this and I'll keep this repo updated. I also feel that there is a need for a repo which shows some best practices.
> You can easily start your project with this template, instead of wasting time figuring out configurations for each integration.
> Whatever you read below this is outdated. All examples needs to be updated to tailwind and screenshots needs to be updated.
## What do you get in this repo
![Storybook UI](assets/Storybook-alert-modern.PNG)
1. A fully functional Svelte + TailwindCSS integration with side-by-side implementation of independent Storybook
2. Storybook with the most essential Addons
3. Storybook populated with basic examples of Svelte + TailwindCSS
### Addons
- Accessibility Addon
![Accessibility Addon](assets/storybook-accessibility-addon.PNG)
- Accessibility Addon - Colorblindness Emulation
![Accessibility Addon - Colorblindness Emulation](assets/storybook-accessibility-addon-colorblindness-emulation.PNG)
- Actions Addon
![Actions Addon](assets/storybook-actions-addon.PNG)
[Storybook](https://storybook.js.org/) is an open source tool for developing JavaScript UI components in isolation
- Notes Addon
[Svelte](https://svelte.dev/) is a component framework that allows you to write highly-efficient, imperative code, that surgically updates the DOM to maintain performance.
![Notes Addon](assets/storybook-Documentation-Component.PNG)
- Source Addon
![Source Addon](assets/storybook-storycode-addon.PNG)
- Viewport Addon
![Source Addon](assets/storybook-viewport-addon.PNG)
## Svelte + TailwindCSS + Storybook
[Storybook](https://storybook.js.org/) is an open source tool for developing JavaScript UI
components in isolation
[Svelte](https://svelte.dev/) is a component framework that allows you to write highly-efficient,
imperative code, that surgically updates the DOM to maintain performance.
[TailwindCSS](https://tailwindcss.com) is a highly customizable, low-level CSS framework that gives
you all of the building blocks you need to build bespoke designs without any annoying opinionated
styles you have to fight to override.
[TailwindCSS](https://tailwindcss.com/) is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override.
## Steps to build
1. Clone this repo `git clone https://github.com/jerriclynsjohn/svelte-storybook-tailwind.git`
2. Go to the directory `cd svelte-storybook-tailwind`
3. Install dependencies `yarn`
4. To develop your Svelte App: `yarn dev`
5. To develop UI components independent of your app: `yarn stories`
### Documentations
1. Svelte - [API](https://svelte.dev/docs) and [Tutorial](https://svelte.dev/tutorial/)
2. TailwindCSS - [Docs](https://tailwindcss.com/docs) and [Tutorial](https://tailwindcss.com/screencasts/)
3. Storybook - [Docs](https://storybook.js.org/docs/basics/introduction/) and [Tutorial](https://www.learnstorybook.com/intro-to-storybook/svelte/en/get-started/)
## Steps to build it all by yourself and some tips [Warning: It's lengthy]
#### Instantiate Svelte + Vite app
### Instantiate Svelte App
- Initiate the project using `npm create vite@latest`
- Select Svelte + Javascript from the CLI
- You have a basic Svelte + Vite app ready
- Start the template file using `npx degit sveltejs/template svelte-storybook-tailwind`
- Go to the directory `cd svelte-storybook-tailwind`
- Install dependencies `yarn`
- Try run the svelte app `yarn dev`
#### Add Tailwind to the project
### Add Tailwind into the project
- Install dependencies `npm install -D tailwindcss postcss autoprefixer`
- Instantiate the tailwind and postcss config files using `npx tailwindcss init -p`
- Update the tailwind config as shown below to accomodate for Svelte components
- Install dependencies:
`yarn add -D tailwindcss @fullhuman/postcss-purgecss autoprefixer postcss postcss-import svelte-preprocess`
- Change the rollup config as shown:
```javascript
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import {terser} from 'rollup-plugin-terser';
import postcss from 'rollup-plugin-postcss';
import autoPreprocess from 'svelte-preprocess';
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'src/main.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/bundle.js'
```js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./index.html', './src/**/*.{svelte,js,ts}'],
theme: {
extend: {}
},
plugins: [
svelte({
preprocess: autoPreprocess({
postcss: true
}),
// enable run-time checks when not in production
dev: !production,
// we'll extract any component CSS out into
// a separate file — better for performance
css: css => {
css.write('public/bundle.css');
}
}),
postcss({
extract: 'public/utils.css'
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration —
// consult the documentation for details:
// https://github.com/rollup/rollup-plugin-commonjs
resolve({
browser: true,
dedupe: importee =>
importee === 'svelte' || importee.startsWith('svelte/')
}),
commonjs(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
],
watch: {
clearScreen: false
}
plugins: []
};
``;
```
- Add tailwind config using the command `npx tailwind init`
- Add PostCSS config `./postcss.config.js` as follows:
- Add Tailwind directive to your CSS at `./src/index.css`
```javascript
const production = !process.env.ROLLUP_WATCH;
const purgecss = require('@fullhuman/postcss-purgecss');
module.exports = {
plugins: [
require('postcss-import')(),
require('tailwindcss'),
require('autoprefixer'),
production &&
purgecss({
content: ['./**/*.html', './**/*.svelte'],
defaultExtractor: content => {
const regExp = new RegExp(/[A-Za-z0-9-_:/]+/g);
const matchedTokens = [];
let match = regExp.exec(content);
// To make sure that you do not lose any tailwind classes used in class directive.
// https://github.com/tailwindcss/discuss/issues/254#issuecomment-517918397
while (match) {
if (match[0].startsWith('class:')) {
matchedTokens.push(match[0].substring(6));
} else {
matchedTokens.push(match[0]);
}
match = regExp.exec(content);
}
return matchedTokens;
}
})
]
};
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```
- Build the project with some TailwindCSS utilities `yarn dev`
### Add Storybook into the Svelte Project
- Add Storybook dependencies `yarn add -D @storybook/svelte`
- Add 5 commonly used Storybook [Addons](https://storybook.js.org/addons/):
- Import CSS into `./src/main.js`
- [Source](https://github.com/storybookjs/storybook/tree/master/addons/storysource):
`yarn add -D @storybook/addon-storysource`
- [Actions](https://github.com/storybookjs/storybook/tree/master/addons/actions):
`yarn add -D @storybook/addon-actions`
- [Notes](https://github.com/storybookjs/storybook/tree/master/addons/notes):
`yarn add -D @storybook/addon-notes`
- [Viewport](https://github.com/storybookjs/storybook/tree/master/addons/viewport):
`yarn add -D @storybook/addon-viewport`
- [Accessibility](https://github.com/storybookjs/storybook/tree/master/addons/a11y):
`yarn add @storybook/addon-a11y --dev`
```js
import './index.css';
import App from './App.svelte';
- Create an addon file at the root `.storybook/addons.js` with the following content and keep
adding additional addons in this file.
const app = new App({
target: document.getElementById('app')
});
```javascript
import '@storybook/addon-storysource/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-notes/register';
import '@storybook/addon-viewport/register';
import '@storybook/addon-a11y/register';
export default app;
```
- Create a config file at the root `.storybook/config.js` with the following content:
```javascript
import {configure, addParameters, addDecorator} from '@storybook/svelte';
import {withA11y} from '@storybook/addon-a11y';
// automatically import all files ending in *.stories.js
const req = require.context('../storybook/stories', true, /\.stories\.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}
- With this we have tailwind setup in the project
configure(loadStories, module);
addDecorator(withA11y);
addParameters({viewport: {viewports: newViewports}});
```
- Add tailwind configs in the `webpack.config.js` under `.storybook` and also accommodate for Source addon:
#### Add storybook and native story format into the project
```javascript
const path = require('path');
- Instantiate by running `npx storybook@next init`
- Hook up TailwindCSS by importing the CSS into `./.storybook/preview.js`
module.exports = ({config, mode}) => {
config.module.rules.push(
{
test: /\.css$/,
loaders: [
{
loader: 'postcss-loader',
options: {
sourceMap: true,
config: {
path: './.storybook/'
}
}
}
],
```js
import '../src/index.css';
include: path.resolve(__dirname, '../storybook/')
},
//This is the new block for the addon
{
test: /\.stories\.js?$/,
loaders: [require.resolve('@storybook/addon-storysource/loader')],
include: [path.resolve(__dirname, '../storybook')],
enforce: 'pre'
export const parameters = {
backgrounds: {
default: 'light'
},
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
);
return config;
};
```
- Create the `postcss.config.js` under `.storybook`:
```javascript
var tailwindcss = require('tailwindcss');
module.exports = {
plugins: [
require('postcss-import')(),
tailwindcss('./tailwind.config.js'),
require('autoprefixer')
]
};
```
- Make sure you have babel and svelte-loader dependencies
`yarn add -D babel-loader @babel/core svelte-loader`
- Add npm script in your `package.json`
```bash
{
"scripts": {
// Rest of the scripts
"stories": "start-storybook",
"build-stories": "build-storybook"
}
}
```
- Add a utils.css file under `storybook/css/` and make sure you `import 'utils.css'` in your
`stories.js` files:
```css
/* Import Tailwind as Global Utils */
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
```
- Write your Svelte component in `storybook\components` and yes you can use your regular `.svelte`
file. The only thing is that you cant use templates in a story yet, not supported, but yes you
can compose other components together. For the starter pack lets just create a clickable button.
```html
<script>
import {createEventDispatcher} from 'svelte';
export let text = '';
const dispatch = createEventDispatcher();
function onClick(event) {
dispatch('click', event);
}
</script>
<button
class="px-4 py-2 font-bold text-white bg-blue-500 rounded hover:bg-blue-700"
on:click="{onClick}"
>
{text}
</button>
```
- Write your stories in `storybook/stories` and you can name any number of story file with
`<anything>.stories.js`, for the starter package we can create stories of `Button` with the
readme notes at `<anything>.stories.md`. Note: reference the css here to make sure that tailwind
is called by postcss:
```javascript
import '../../css/utils.css';
import {storiesOf} from '@storybook/svelte';
import ButtonSimple from '../../components/buttons/button-simple.svelte';
import markdownNotes from './buttons.stories.md';
storiesOf('Buttons | Buttons', module)
//Simple Button
.add(
'Simple',
() => ({
Component: ButtonSimple,
props: {text: 'Button'},
on: {
click: action('I am logging in the actions tab too')
}
}),
{notes: {markdown: markdownNotes}}
);
```
- Write your own Documentation for the Component which will `<anything>.stories.md` :
```md
# Buttons
_Examples of building buttons with Tailwind CSS._
---
Tailwind doesn't include pre-designed button styles out of the box, but they're easy to build using
existing utilities.
Here are a few examples to help you get an idea of how to build components like this using Tailwind.
};
```
- Run your storyboard `yarn stories` and you'll see this:
![Storybook UI](storybook-ui.PNG)
You can add more addons and play around with them.
That's a wrap!
- This completes the setup required for the project
## License
### Best Practices for UI Component Library
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjerriclynsjohn%2Fsvelte-storybook-tailwind?ref=badge_large)
- Watchout for this space for more, will be updatin with some good best practises till then do feel free to explore the example UI components used for this website.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Svelte + Storybook + TailwindCSS</title>
<!-- Poppins -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;600;700&display=swap"
rel="stylesheet" />
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

@ -0,0 +1,33 @@
{
"compilerOptions": {
"moduleResolution": "Node",
"target": "ESNext",
"module": "ESNext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}

51532
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,57 +1,44 @@
{
"name": "svelte-storybook-tailwind",
"author": "Jerric Lyns John",
"license": "MIT",
"version": "0.0.3",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public --no-clear",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"static-stories": "build-storybook -c .storybook -o .out",
"format": "prettier --check .",
"format-fix": "prettier --write .",
"prelint": "npm run format-fix",
"lint": "eslint --ext .cjs,.js,.ts,.json,.svelte .",
"lint-fix": "eslint --fix --ext .cjs,.js,.ts,.json,.svelte ."
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"storybook": "storybook dev -p 6006 -s public",
"build-storybook": "storybook build"
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@storybook/addon-a11y": "^6.4.13",
"@storybook/addon-actions": "^6.4.13",
"@storybook/addon-essentials": "^6.4.13",
"@storybook/addon-links": "^6.4.13",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/addon-storysource": "^6.4.13",
"@storybook/addon-svelte-csf": "^1.1.0",
"@storybook/svelte": "^6.4.13",
"autoprefixer": "^10.4.2",
"babel-loader": "^8.2.3",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"@storybook/addon-essentials": "^7.0.0-beta.51",
"@storybook/addon-interactions": "^7.0.0-beta.51",
"@storybook/addon-links": "^7.0.0-beta.51",
"@storybook/addon-svelte-csf": "^3.0.0-next.3",
"@storybook/blocks": "^7.0.0-beta.51",
"@storybook/svelte": "^7.0.0-beta.51",
"@storybook/svelte-vite": "^7.0.0-beta.51",
"@storybook/testing-library": "^0.0.14-next.1",
"@sveltejs/vite-plugin-svelte": "^2.0.2",
"autoprefixer": "^10.4.13",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-svelte3": "^3.4.0",
"postcss": "^8.4.5",
"postcss-cli": "^9.1.0",
"prettier": "^2.5.1",
"prettier-plugin-svelte": "^2.6.0",
"rollup": "^2.3.4",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"stylelint": "^14.2.0",
"stylelint-config-standard": "^24.0.0",
"svelte": "^3.46.2",
"svelte-loader": "^3.1.2",
"svelte-preprocess": "^4.10.1",
"tailwindcss": "^3.0.15"
},
"dependencies": {
"sirv-cli": "^2.0.0"
"eslint-plugin-storybook": "^0.6.10",
"eslint-plugin-svelte3": "^4.0.0",
"postcss": "^8.4.21",
"prettier": "^2.8.4",
"prettier-plugin-svelte": "^2.9.0",
"prettier-plugin-tailwindcss": "^0.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^7.0.0-beta.51",
"stylelint": "^15.2.0",
"stylelint-config-standard": "^30.0.1",
"svelte": "^3.55.1",
"svelte-loader": "^3.1.6",
"tailwindcss": "^3.2.7",
"vite": "^4.1.0"
}
}

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

@ -1,6 +0,0 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

@ -0,0 +1,5 @@
<svg width="68" height="81" viewBox="0 0 68 81" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M60.1646 13.542C53.4702 3.96055 40.2487 1.12057 30.689 7.2114L13.8997 17.912C11.6316 19.3389 9.68616 21.2233 8.18778 23.4448C6.6894 25.6663 5.67103 28.176 5.19775 30.8134C4.3969 35.2561 5.10083 39.839 7.19809 43.8365C5.76099 46.0166 4.78083 48.4654 4.31685 51.0349C3.83854 53.7255 3.90231 56.4845 4.50442 59.1501C5.10652 61.8157 6.23483 64.3343 7.82319 66.5581C14.519 76.1404 27.7406 78.9792 37.2989 72.8887L54.0882 62.1881C56.3564 60.7613 58.3019 58.877 59.8003 56.6555C61.2987 54.4339 62.317 51.9242 62.7901 49.2866C63.5907 44.844 62.8873 40.2612 60.791 36.2632C62.2277 34.0832 63.2074 31.6345 63.671 29.0652C64.1496 26.3746 64.086 23.6155 63.4839 20.9498C62.8818 18.2842 61.7533 15.7656 60.1646 13.542Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.689 7.21142C40.2487 1.12059 53.4702 3.96057 60.1646 13.542C61.7533 15.7657 62.8818 18.2842 63.4839 20.9499C64.086 23.6155 64.1496 26.3746 63.671 29.0652C63.2074 31.6345 62.2277 34.0832 60.791 36.2632C62.8873 40.2612 63.5907 44.844 62.7901 49.2866C62.317 51.9242 61.2987 54.4339 59.8003 56.6555C58.3019 58.877 56.3564 60.7614 54.0882 62.1881L37.2989 72.8887C27.7406 78.9792 14.519 76.1404 7.82319 66.5581C6.23483 64.3343 5.10652 61.8158 4.50442 59.1501C3.90231 56.4845 3.83854 53.7255 4.31685 51.0349C4.78083 48.4654 5.76099 46.0166 7.19809 43.8366C5.10083 39.839 4.3969 35.2561 5.19775 30.8134C5.67103 28.176 6.6894 25.6663 8.18778 23.4448C9.68616 21.2233 11.6316 19.3389 13.8997 17.912L30.689 7.21142ZM1.26092 30.1054C1.8326 26.9208 3.06235 23.8905 4.87161 21.2081C6.67887 18.5286 9.02464 16.2552 11.7593 14.5328L28.5391 3.83828C39.9914 -3.45833 55.5688 -0.000680923 63.4316 11.2339C65.3234 13.8868 66.6676 16.8901 67.3856 20.0686C68.105 23.2538 68.1811 26.5507 67.6092 29.7657L67.6074 29.7754C67.1844 32.1202 66.4052 34.3818 65.3007 36.4829C67.0453 40.7443 67.5489 45.4302 66.7272 49.9928C66.1559 53.1782 64.9261 56.2093 63.1165 58.8922C61.3092 61.5716 58.9634 63.845 56.2286 65.5672C56.2251 65.5695 56.2215 65.5717 56.2179 65.574L39.4488 76.2618C27.9978 83.5583 12.4203 80.1016 4.55616 68.8661C2.66463 66.2131 1.32062 63.2098 0.602712 60.0314C-0.116723 56.8464 -0.192918 53.5497 0.378597 50.3348L0.380494 50.3241C0.803887 47.9794 1.58334 45.718 2.68798 43.617C0.942413 39.3554 0.438639 34.6686 1.26092 30.1054Z" fill="black"/>
<path d="M29.0487 67.4595C26.4066 68.1464 23.6174 68.006 21.0577 67.0571C18.4981 66.1083 16.2912 64.3968 14.7353 62.1538C13.7799 60.8166 13.1012 59.302 12.739 57.699C12.3768 56.0959 12.3384 54.4367 12.6261 52.8186C12.7235 52.2874 12.8576 51.7635 13.0273 51.2508L13.3435 50.2866L14.2036 50.9184C16.1901 52.378 18.4113 53.4878 20.7713 54.1999L21.3953 54.3892L21.3378 55.0119C21.2616 55.8979 21.5015 56.7823 22.015 57.5083C22.4833 58.1839 23.1476 58.6996 23.9183 58.9857C24.689 59.2717 25.529 59.3144 26.3247 59.1078C26.6895 59.0103 27.0373 58.8575 27.3559 58.6546L44.1452 47.9552C44.556 47.6965 44.9085 47.3551 45.1801 46.9527C45.4517 46.5503 45.6365 46.0958 45.7227 45.618C45.8089 45.1303 45.797 44.6303 45.6879 44.1472C45.5788 43.6641 45.3745 43.2076 45.087 42.8043C44.6185 42.1285 43.9539 41.6126 43.1829 41.3264C42.412 41.0402 41.5718 40.9974 40.7757 41.2038C40.4113 41.3013 40.064 41.4541 39.7458 41.6567L33.3389 45.7409C32.2854 46.4107 31.1357 46.9156 29.9297 47.238C27.2876 47.925 24.4983 47.7846 21.9385 46.8358C19.3787 45.8869 17.1718 44.1754 15.6158 41.9323C14.6604 40.5951 13.9817 39.0805 13.6196 37.4775C13.2574 35.8744 13.219 34.2152 13.5067 32.5971C13.7913 31.0112 14.4037 29.502 15.3048 28.1663C16.206 26.8305 17.3759 25.6975 18.7399 24.8398L35.5282 14.1395C36.5822 13.4686 37.7327 12.963 38.9398 12.6405C41.5819 11.9536 44.3711 12.094 46.9308 13.0429C49.4905 13.9917 51.6973 15.7032 53.2533 17.9463C54.2087 19.2835 54.8874 20.798 55.2496 22.4011C55.6118 24.0041 55.6501 25.6634 55.3624 27.2814C55.2646 27.8126 55.1306 28.3364 54.9612 28.8493L54.645 29.8134L53.7853 29.1826C51.799 27.7221 49.5776 26.6119 47.2173 25.8998L46.5933 25.7104L46.6507 25.0876C46.7264 24.2017 46.4866 23.3176 45.9736 22.5914C45.5053 21.9157 44.841 21.4 44.0703 21.1139C43.2996 20.8279 42.4596 20.7852 41.6639 20.9918C41.2991 21.0893 40.9513 21.2422 40.6327 21.445L23.843 32.1448C23.4322 32.4033 23.0797 32.7447 22.8083 33.1472C22.5368 33.5496 22.3523 34.0043 22.2665 34.4821C22.1798 34.9697 22.1913 35.4698 22.3002 35.953C22.4092 36.4362 22.6134 36.8928 22.901 37.2961C23.3695 37.9719 24.0341 38.4877 24.8051 38.7739C25.576 39.0601 26.4162 39.103 27.2123 38.8966C27.577 38.7989 27.9248 38.646 28.2435 38.4434L34.6495 34.3607C35.7026 33.69 36.8522 33.1847 38.0584 32.8623C40.7005 32.1754 43.4898 32.3158 46.0495 33.2647C48.6093 34.2135 50.8162 35.925 52.3722 38.1681C53.3276 39.5053 54.0063 41.0199 54.3684 42.6229C54.7306 44.226 54.769 45.8852 54.4813 47.5032C54.1965 49.0893 53.584 50.5985 52.6829 51.9345C51.7818 53.2704 50.612 54.4037 49.2481 55.2618L32.46 65.9605C31.4061 66.6315 30.2557 67.137 29.0487 67.4595Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Svelte + Tailwind + Storybook</title>
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="stylesheet" href="/build/main.css" />
<script defer src="/build/bundle.js"></script>
</head>
<body></body>
</html>

@ -1,78 +0,0 @@
import svelte from 'rollup-plugin-svelte';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import livereload from 'rollup-plugin-livereload';
import {terser} from 'rollup-plugin-terser';
import postcss from 'rollup-plugin-postcss';
import sveltePreprocess from 'svelte-preprocess';
const production = !process.env.ROLLUP_WATCH;
function serve() {
let server;
function toExit() {
if (server) server.kill(0);
}
return {
writeBundle() {
if (server) return;
server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
stdio: ['ignore', 'inherit', 'inherit'],
shell: true
});
process.on('SIGTERM', toExit);
process.on('exit', toExit);
}
};
}
export default {
input: 'src/main.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js'
},
plugins: [
svelte({
preprocess: sveltePreprocess({postcss: true}),
compilerOptions: {
// enable run-time checks when not in production
dev: !production
}
}),
// we'll extract any component CSS out into
// a separate file - better for performance
postcss({extract: 'main.css'}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
// In dev mode, call `npm run start` once
// the bundle has been generated
!production && serve(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
],
watch: {
clearScreen: false
}
};

@ -1,12 +1,5 @@
<script>
import Nav from './components/nav.svelte';
import Button from './components/Button.svelte';
let menuItems = [
{link: '#', name: 'Docs'},
{link: '#', name: 'Home'},
{link: '#', name: 'Blog'}
];
import Main from './lib/pages/Main.svelte';
</script>
<Nav {menuItems} />
<Button text="Something" />
<Main />

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

@ -0,0 +1,51 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 556 312">
<g clip-path="url(#a)">
<rect width="554.927" height="310.829" x=".537" y=".585" fill="#F8FAFC" rx="10"/>
<path stroke="#FFF5EC" stroke-width="2" d="M.537 161.612c408.604-2.287 384.585 143.827 821.212 148.402"/>
<path stroke="#FFE9D3" stroke-width="2" d="M.537 177.362c408.604-2.044 384.585 128.562 821.212 132.652"/>
<path stroke="#FFCEA5" stroke-width="2" d="M.537 194.516c408.604-1.781 384.585 111.937 821.212 115.498"/>
<path stroke="#FFAC6D" stroke-width="2" d="M.537 210.525c408.604-1.533 384.585 96.421 821.212 99.489"/>
<path stroke="#FF7D32" stroke-width="2" d="M.537 227.679c408.604-1.27 384.585 79.797 821.212 82.335"/>
<path stroke="#FF590A" stroke-width="2" d="M.537 242.545c408.604-1.04 384.585 65.389 821.212 67.469"/>
<path stroke="#FF3E00" stroke-width="2" d="M.537 259.126c408.604-.784 384.585 49.319 821.212 50.888"/>
<path stroke="#CC2902" stroke-width="2" d="M.537 276.279c408.604-.52 384.585 32.695 821.212 33.735"/>
<path stroke="#A1210B" stroke-width="2" d="M.537 293.432c408.604-.255 384.585 16.07 821.212 16.582"/>
<path stroke="#821E0C" stroke-width="2" d="M.537 310.014c408.604-.009 384.585.554 821.212.571"/>
<path stroke="#FFF5EC" stroke-width="2" d="M632.749 176.558C224.144 178.846 248.163 32.732-188.464 28.157"/>
<path stroke="#FFE9D3" stroke-width="2" d="M632.749 160.808C224.144 162.853 248.163 32.246-188.464 28.157"/>
<path stroke="#FFCEA5" stroke-width="2" d="M632.749 143.654C224.144 145.435 248.163 31.717-188.464 28.156"/>
<path stroke="#FFAC6D" stroke-width="2" d="M632.749 127.645c-408.605 1.534-384.586-96.421-821.213-99.488"/>
<path stroke="#FF7D32" stroke-width="2" d="M632.749 110.492c-408.605 1.269-384.586-79.797-821.213-82.336"/>
<path stroke="#FF590A" stroke-width="2" d="M632.749 95.625c-408.605 1.04-384.586-65.389-821.213-67.469"/>
<path stroke="#FF3E00" stroke-width="2" d="M632.749 79.044c-408.605.785-384.586-49.319-821.213-50.888"/>
<path stroke="#CC2902" stroke-width="2" d="M632.749 61.891c-408.605.52-384.586-32.694-821.213-33.734"/>
<path stroke="#A1210B" stroke-width="2" d="M632.749 44.738c-408.605.256-384.586-16.07-821.213-16.581"/>
<path stroke="#821E0C" stroke-width="2" d="M632.749 28.157c-408.605.008-384.586-.555-821.213-.572"/>
<path fill="#E2E2E1" d="M555.444 27.005V5.65a5.067 5.067 0 0 0-5.068-5.065H5.605A5.068 5.068 0 0 0 .537 5.65v21.376h554.907v-.021Z"/>
<path fill="#70B34A" d="M505.182 13.795a5.703 5.703 0 0 1-11.404 0 5.703 5.703 0 0 1 11.404 0Z"/>
<path fill="#DDAA54" d="M524.464 13.795a5.703 5.703 0 0 1-11.404 0 5.703 5.703 0 0 1 11.404 0Z"/>
<path fill="#D5655D" d="M543.829 13.795a5.703 5.703 0 0 1-11.404 0 5.703 5.703 0 0 1 5.702-5.697 5.69 5.69 0 0 1 5.702 5.697Z"/>
<path fill="#000" fill-rule="evenodd" d="M262.095 151h12.619v2.533h2.524V189h-12.619v-2.533h-2.524V177.6h-7.571V189h-12.619v-2.533h-2.524V151H252v2.533h2.524v8.867h7.571V151Zm-21.452 1.267h10.095V162.4h-10.095v-10.133Zm11.357 11.4V173.8h10.095v-10.133H252Zm11.357 11.4h10.095V185.2h-10.095v-10.133Zm10.095-11.4V173.8h-10.095v-10.133h10.095Zm0-11.4V162.4h-10.095v-10.133h10.095ZM250.738 173.8v-10.133h-10.095V173.8h10.095Zm0 1.267h-10.095V185.2h10.095v-10.133ZM279.762 151h12.619v2.533h2.524V173.8h7.571V151h12.619v2.533h2.524V189h-35.333v-2.533h-2.524V151Zm11.357 22.8v-10.133h-10.095V173.8h10.095Zm11.357 1.267h-10.095V185.2h10.095v-10.133Zm1.262-1.267v-10.133h10.095V173.8h-10.095Zm0-11.4v-10.133h10.095V162.4h-10.095Zm10.095 12.667h-10.095V185.2h10.095v-10.133ZM291.119 185.2h-10.095v-10.133h10.095V185.2Zm-10.095-22.8h10.095v-10.133h-10.095V162.4Zm39.119-11.4v35.467h2.524V189H358v-35.467h-2.524V151h-35.333Zm11.357 12.667V173.8h-10.095v-10.133H331.5Zm1.262 10.133v-10.133h10.095V173.8h-10.095Zm21.452-11.4h-10.095v-10.133h10.095V162.4Zm-10.095 1.267h10.095V173.8h-10.095v-10.133Zm0 11.4h10.095V185.2h-10.095v-10.133Zm-11.357 0h10.095V185.2h-10.095v-10.133ZM331.5 185.2v-10.133h-10.095V185.2H331.5Zm0-32.933V162.4h-10.095v-10.133H331.5Zm11.357 10.133h-10.095v-10.133h10.095V162.4Z" clip-rule="evenodd"/>
<path fill="#fff" d="M250.738 152.267h-10.095V162.4h10.095v-10.133Z"/>
<path fill="#FF3E00" d="M250.738 163.667V173.8h-10.095v-10.133h10.095Z"/>
<path fill="#fff" d="M252 173.8v-10.133h10.095V173.8H252Z"/>
<path fill="#FF3E00" d="M273.452 173.8v-10.133h-10.095V173.8h10.095Z"/>
<path fill="#fff" d="M273.452 162.4v-10.133h-10.095V162.4h10.095Zm-32.809 12.667h10.095V185.2h-10.095v-10.133Zm32.809 0h-10.095V185.2h10.095v-10.133Zm17.667-12.667h-10.095v-10.133h10.095V162.4Z"/>
<path fill="#FF3E00" d="M291.119 163.667V173.8h-10.095v-10.133h10.095Zm12.619 0V173.8h10.095v-10.133h-10.095Zm-11.357 11.4h10.095V185.2h-10.095v-10.133Z"/>
<path fill="#fff" d="M303.738 152.267V162.4h10.095v-10.133h-10.095Zm0 22.8h10.095V185.2h-10.095v-10.133ZM281.024 185.2h10.095v-10.133h-10.095V185.2Zm50.476-22.8v-10.133h-10.095V162.4H331.5Zm1.262 1.267V173.8h10.095v-10.133h-10.095Zm21.452 11.4h-10.095V185.2h10.095v-10.133ZM344.119 162.4h10.095v-10.133h-10.095V162.4ZM331.5 175.067V185.2h-10.095v-10.133H331.5Z"/>
<path fill="#FF3E00" d="M331.5 173.8v-10.133h-10.095V173.8H331.5Zm1.262-11.4h10.095v-10.133h-10.095V162.4Zm21.452 1.267h-10.095V173.8h10.095v-10.133Zm-11.357 11.4h-10.095V185.2h10.095v-10.133Z"/>
<path fill="#fff" d="M224.902 160.323c-2.112-3.034-6.283-3.933-9.299-2.005l-5.296 3.389a6.116 6.116 0 0 0-2.746 4.085 6.453 6.453 0 0 0 .631 4.124 6.151 6.151 0 0 0-.909 2.28 6.523 6.523 0 0 0 1.107 4.915c2.112 3.035 6.283 3.934 9.298 2.005l5.297-3.388a6.093 6.093 0 0 0 2.745-4.086 6.446 6.446 0 0 0-.63-4.124c.453-.69.762-1.466.908-2.279a6.522 6.522 0 0 0-1.106-4.916Z"/>
<path fill="#000" d="M215.086 177.397a4.206 4.206 0 0 1-4.516-1.68 3.921 3.921 0 0 1-.665-2.956c.03-.169.073-.335.126-.497l.1-.305.271.2a6.848 6.848 0 0 0 2.072 1.039l.197.06-.018.197c-.024.281.052.561.214.791.147.214.357.377.6.467.243.091.508.105.759.039.115-.031.225-.079.325-.143l5.297-3.389a1.098 1.098 0 0 0 .498-.74 1.194 1.194 0 0 0-.201-.891 1.265 1.265 0 0 0-1.36-.506 1.15 1.15 0 0 0-.325.143l-2.021 1.293a3.85 3.85 0 0 1-1.076.474 4.193 4.193 0 0 1-4.515-1.68 3.9 3.9 0 0 1-.63-1.41 3.945 3.945 0 0 1-.036-1.546 3.67 3.67 0 0 1 1.651-2.456l5.297-3.389a3.85 3.85 0 0 1 1.076-.474 4.185 4.185 0 0 1 2.521.127c.807.3 1.504.842 1.995 1.553a3.914 3.914 0 0 1 .665 2.956 3.68 3.68 0 0 1-.127.496l-.099.306-.272-.2a6.805 6.805 0 0 0-2.072-1.04l-.197-.06.019-.197c.023-.28-.052-.56-.214-.79a1.263 1.263 0 0 0-1.36-.507 1.153 1.153 0 0 0-.325.144l-5.297 3.388a1.107 1.107 0 0 0-.497.74 1.18 1.18 0 0 0 .2.891 1.262 1.262 0 0 0 1.36.507 1.14 1.14 0 0 0 .325-.144l2.021-1.292a3.836 3.836 0 0 1 1.076-.475 4.2 4.2 0 0 1 4.516 1.68 3.919 3.919 0 0 1 .665 2.956 3.676 3.676 0 0 1-1.651 2.457l-5.296 3.388a3.849 3.849 0 0 1-1.076.475Z"/>
<path fill="#000" fill-rule="evenodd" d="M199 151h35.333v2.533h2.524V189h-35.333v-2.533H199V151Zm34.071 1.267h-32.809V185.2h32.809v-32.933Z" clip-rule="evenodd"/>
<path fill="#FF3E00" d="M200.262 152.267h32.809V185.2h-32.809v-32.933Z"/>
<path fill="#fff" d="M224.901 160.325c-2.112-3.035-6.283-3.934-9.299-2.005l-5.296 3.388a6.093 6.093 0 0 0-2.745 4.086 6.44 6.44 0 0 0 .631 4.124 6.113 6.113 0 0 0-.909 2.279 6.522 6.522 0 0 0 1.106 4.916c2.112 3.034 6.283 3.933 9.299 2.005l5.296-3.389a6.116 6.116 0 0 0 2.746-4.085 6.453 6.453 0 0 0-.631-4.124 6.132 6.132 0 0 0 .908-2.28 6.522 6.522 0 0 0-1.106-4.915Z"/>
<path fill="#000" fill-rule="evenodd" d="M215.602 158.32c3.016-1.929 7.187-1.03 9.299 2.005a6.51 6.51 0 0 1 1.106 4.915 6.132 6.132 0 0 1-.908 2.28 6.453 6.453 0 0 1 .631 4.124 6.116 6.116 0 0 1-2.746 4.085l-5.296 3.389c-3.016 1.928-7.187 1.029-9.299-2.005a6.514 6.514 0 0 1-1.106-4.916 6.113 6.113 0 0 1 .909-2.279 6.44 6.44 0 0 1-.631-4.124 6.11 6.11 0 0 1 2.745-4.086l5.296-3.388Zm-9.283 7.249a7.37 7.37 0 0 1 3.312-4.931l5.293-3.386c3.613-2.311 8.528-1.216 11.008 2.341a7.799 7.799 0 0 1 1.318 5.869v.003a7.432 7.432 0 0 1-.728 2.124 7.724 7.724 0 0 1 .45 4.278 7.369 7.369 0 0 1-3.312 4.932l-.004.002-5.29 3.385c-3.612 2.31-8.527 1.216-11.008-2.342a7.806 7.806 0 0 1-1.318-5.869l.001-.003c.134-.742.38-1.459.728-2.124a7.71 7.71 0 0 1-.45-4.279Z" clip-rule="evenodd"/>
<path fill="#000" d="M215.085 177.398a4.202 4.202 0 0 1-4.516-1.68 3.926 3.926 0 0 1-.665-2.956c.031-.168.073-.334.126-.496l.1-.306.272.2a6.786 6.786 0 0 0 2.071 1.039l.197.06-.018.198c-.024.28.052.56.214.79a1.262 1.262 0 0 0 1.359.507c.116-.031.225-.08.326-.144l5.296-3.388a1.11 1.11 0 0 0 .487-1.206 1.266 1.266 0 0 0-1.55-.932 1.18 1.18 0 0 0-.325.143l-2.021 1.294a3.856 3.856 0 0 1-1.075.474 4.2 4.2 0 0 1-4.516-1.68 3.921 3.921 0 0 1-.665-2.956 3.661 3.661 0 0 1 1.651-2.457l5.296-3.388a3.823 3.823 0 0 1 1.076-.475 4.2 4.2 0 0 1 4.516 1.68 3.921 3.921 0 0 1 .665 2.956 3.848 3.848 0 0 1-.126.497l-.1.305-.271-.2a6.826 6.826 0 0 0-2.072-1.039l-.197-.06.018-.197a1.197 1.197 0 0 0-.214-.791 1.262 1.262 0 0 0-1.359-.506c-.116.03-.225.079-.326.143l-5.296 3.388a1.101 1.101 0 0 0-.498.741 1.175 1.175 0 0 0 .2.891 1.262 1.262 0 0 0 1.36.506c.115-.03.225-.079.326-.143l2.021-1.293a3.856 3.856 0 0 1 1.075-.474 4.202 4.202 0 0 1 4.516 1.68 3.926 3.926 0 0 1 .665 2.956 3.667 3.667 0 0 1-1.651 2.457l-5.296 3.388a3.862 3.862 0 0 1-1.076.474Z"/>
</g>
<rect width="553.927" height="309.829" x="1.037" y="1.085" stroke="#E2E8F0" rx="9.5"/>
<defs>
<clipPath id="a">
<rect width="554.927" height="310.829" x=".537" y=".585" fill="#fff" rx="10"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 9.4 KiB

@ -1,19 +0,0 @@
<script>
export let text = '';
</script>
<button class="btn-outline btn-outline-color">{text}</button>
<style>
.btn-outline {
@apply font-semibold py-2 px-4;
}
.btn-outline-color {
@apply bg-transparent text-blue-700 border border-blue-500 rounded;
}
.btn-outline-color:hover {
@apply bg-red-500 text-white border-transparent;
}
</style>

@ -1,55 +0,0 @@
<script>
export let menuItems = [];
</script>
<nav class="flex flex-wrap items-center justify-between p-6 bg-teal-500">
<div class="flex items-center flex-shrink-0 mr-6 text-white">
<svg
class="w-8 h-8 mr-2 fill-current"
width="54"
height="54"
viewBox="0 0 54 54"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.5 22.1c1.8-7.2 6.3-10.8 13.5-10.8 10.8 0 12.15 8.1 17.55
9.45 3.6.9 6.75-.45 9.45-4.05-1.8 7.2-6.3 10.8-13.5 10.8-10.8
0-12.15-8.1-17.55-9.45-3.6-.9-6.75.45-9.45 4.05zM0 38.3c1.8-7.2
6.3-10.8 13.5-10.8 10.8 0 12.15 8.1 17.55 9.45 3.6.9 6.75-.45
9.45-4.05-1.8 7.2-6.3 10.8-13.5 10.8-10.8
0-12.15-8.1-17.55-9.45-3.6-.9-6.75.45-9.45 4.05z"
/>
</svg>
<span class="text-xl font-semibold tracking-tight">Tailwind CSS</span>
</div>
<div class="block lg:hidden">
<button
class="flex items-center px-3 py-2 text-teal-200 border border-teal-400 rounded hover:text-white hover:border-white"
>
<svg class="w-3 h-3 fill-current" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<title>Menu</title>
<path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" />
</svg>
</button>
</div>
<div class="flex-grow block w-full lg:flex lg:items-center lg:w-auto">
<div class="text-sm lg:flex-grow">
{#each menuItems as item}
<a
href={item.link}
class="block mt-4 mr-4 text-teal-200 lg:inline-block lg:mt-0 hover:text-white"
>
{item.name}
</a>
{/each}
</div>
<div>
<a
href="#"
class="inline-block px-4 py-2 mt-4 text-sm leading-none text-white border border-white rounded hover:border-transparent hover:text-teal-500 hover:bg-white lg:mt-0"
>
Download
</a>
</div>
</div>
</nav>

@ -0,0 +1,5 @@
<svg width="68" height="81" viewBox="0 0 68 81" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M60.1646 13.542C53.4702 3.96055 40.2487 1.12057 30.689 7.2114L13.8997 17.912C11.6316 19.3389 9.68616 21.2233 8.18778 23.4448C6.6894 25.6663 5.67103 28.176 5.19775 30.8134C4.3969 35.2561 5.10083 39.839 7.19809 43.8365C5.76099 46.0166 4.78083 48.4654 4.31685 51.0349C3.83854 53.7255 3.90231 56.4845 4.50442 59.1501C5.10652 61.8157 6.23483 64.3343 7.82319 66.5581C14.519 76.1404 27.7406 78.9792 37.2989 72.8887L54.0882 62.1881C56.3564 60.7613 58.3019 58.877 59.8003 56.6555C61.2987 54.4339 62.317 51.9242 62.7901 49.2866C63.5907 44.844 62.8873 40.2612 60.791 36.2632C62.2277 34.0832 63.2074 31.6345 63.671 29.0652C64.1496 26.3746 64.086 23.6155 63.4839 20.9498C62.8818 18.2842 61.7533 15.7656 60.1646 13.542Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.689 7.21142C40.2487 1.12059 53.4702 3.96057 60.1646 13.542C61.7533 15.7657 62.8818 18.2842 63.4839 20.9499C64.086 23.6155 64.1496 26.3746 63.671 29.0652C63.2074 31.6345 62.2277 34.0832 60.791 36.2632C62.8873 40.2612 63.5907 44.844 62.7901 49.2866C62.317 51.9242 61.2987 54.4339 59.8003 56.6555C58.3019 58.877 56.3564 60.7614 54.0882 62.1881L37.2989 72.8887C27.7406 78.9792 14.519 76.1404 7.82319 66.5581C6.23483 64.3343 5.10652 61.8158 4.50442 59.1501C3.90231 56.4845 3.83854 53.7255 4.31685 51.0349C4.78083 48.4654 5.76099 46.0166 7.19809 43.8366C5.10083 39.839 4.3969 35.2561 5.19775 30.8134C5.67103 28.176 6.6894 25.6663 8.18778 23.4448C9.68616 21.2233 11.6316 19.3389 13.8997 17.912L30.689 7.21142ZM1.26092 30.1054C1.8326 26.9208 3.06235 23.8905 4.87161 21.2081C6.67887 18.5286 9.02464 16.2552 11.7593 14.5328L28.5391 3.83828C39.9914 -3.45833 55.5688 -0.000680923 63.4316 11.2339C65.3234 13.8868 66.6676 16.8901 67.3856 20.0686C68.105 23.2538 68.1811 26.5507 67.6092 29.7657L67.6074 29.7754C67.1844 32.1202 66.4052 34.3818 65.3007 36.4829C67.0453 40.7443 67.5489 45.4302 66.7272 49.9928C66.1559 53.1782 64.9261 56.2093 63.1165 58.8922C61.3092 61.5716 58.9634 63.845 56.2286 65.5672C56.2251 65.5695 56.2215 65.5717 56.2179 65.574L39.4488 76.2618C27.9978 83.5583 12.4203 80.1016 4.55616 68.8661C2.66463 66.2131 1.32062 63.2098 0.602712 60.0314C-0.116723 56.8464 -0.192918 53.5497 0.378597 50.3348L0.380494 50.3241C0.803887 47.9794 1.58334 45.718 2.68798 43.617C0.942413 39.3554 0.438639 34.6686 1.26092 30.1054Z" fill="black"/>
<path d="M29.0487 67.4595C26.4066 68.1464 23.6174 68.006 21.0577 67.0571C18.4981 66.1083 16.2912 64.3968 14.7353 62.1538C13.7799 60.8166 13.1012 59.302 12.739 57.699C12.3768 56.0959 12.3384 54.4367 12.6261 52.8186C12.7235 52.2874 12.8576 51.7635 13.0273 51.2508L13.3435 50.2866L14.2036 50.9184C16.1901 52.378 18.4113 53.4878 20.7713 54.1999L21.3953 54.3892L21.3378 55.0119C21.2616 55.8979 21.5015 56.7823 22.015 57.5083C22.4833 58.1839 23.1476 58.6996 23.9183 58.9857C24.689 59.2717 25.529 59.3144 26.3247 59.1078C26.6895 59.0103 27.0373 58.8575 27.3559 58.6546L44.1452 47.9552C44.556 47.6965 44.9085 47.3551 45.1801 46.9527C45.4517 46.5503 45.6365 46.0958 45.7227 45.618C45.8089 45.1303 45.797 44.6303 45.6879 44.1472C45.5788 43.6641 45.3745 43.2076 45.087 42.8043C44.6185 42.1285 43.9539 41.6126 43.1829 41.3264C42.412 41.0402 41.5718 40.9974 40.7757 41.2038C40.4113 41.3013 40.064 41.4541 39.7458 41.6567L33.3389 45.7409C32.2854 46.4107 31.1357 46.9156 29.9297 47.238C27.2876 47.925 24.4983 47.7846 21.9385 46.8358C19.3787 45.8869 17.1718 44.1754 15.6158 41.9323C14.6604 40.5951 13.9817 39.0805 13.6196 37.4775C13.2574 35.8744 13.219 34.2152 13.5067 32.5971C13.7913 31.0112 14.4037 29.502 15.3048 28.1663C16.206 26.8305 17.3759 25.6975 18.7399 24.8398L35.5282 14.1395C36.5822 13.4686 37.7327 12.963 38.9398 12.6405C41.5819 11.9536 44.3711 12.094 46.9308 13.0429C49.4905 13.9917 51.6973 15.7032 53.2533 17.9463C54.2087 19.2835 54.8874 20.798 55.2496 22.4011C55.6118 24.0041 55.6501 25.6634 55.3624 27.2814C55.2646 27.8126 55.1306 28.3364 54.9612 28.8493L54.645 29.8134L53.7853 29.1826C51.799 27.7221 49.5776 26.6119 47.2173 25.8998L46.5933 25.7104L46.6507 25.0876C46.7264 24.2017 46.4866 23.3176 45.9736 22.5914C45.5053 21.9157 44.841 21.4 44.0703 21.1139C43.2996 20.8279 42.4596 20.7852 41.6639 20.9918C41.2991 21.0893 40.9513 21.2422 40.6327 21.445L23.843 32.1448C23.4322 32.4033 23.0797 32.7447 22.8083 33.1472C22.5368 33.5496 22.3523 34.0043 22.2665 34.4821C22.1798 34.9697 22.1913 35.4698 22.3002 35.953C22.4092 36.4362 22.6134 36.8928 22.901 37.2961C23.3695 37.9719 24.0341 38.4877 24.8051 38.7739C25.576 39.0601 26.4162 39.103 27.2123 38.8966C27.577 38.7989 27.9248 38.646 28.2435 38.4434L34.6495 34.3607C35.7026 33.69 36.8522 33.1847 38.0584 32.8623C40.7005 32.1754 43.4898 32.3158 46.0495 33.2647C48.6093 34.2135 50.8162 35.925 52.3722 38.1681C53.3276 39.5053 54.0063 41.0199 54.3684 42.6229C54.7306 44.226 54.769 45.8852 54.4813 47.5032C54.1965 49.0893 53.584 50.5985 52.6829 51.9345C51.7818 53.2704 50.612 54.4037 49.2481 55.2618L32.46 65.9605C31.4061 66.6315 30.2557 67.137 29.0487 67.4595Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

@ -0,0 +1,32 @@
<script>
import {Meta, Story} from '@storybook/addon-svelte-csf';
import Button from './Button.svelte';
import Icon from './Icon.svelte';
</script>
<Meta title="Design System/Atoms/Button" component={Button} />
<!-- Primary -->
<Story name="Primary">
<Button href="https://google.com">Primary</Button>
</Story>
<Story name="Primary with icon on left">
<Button left href="https://google.com"><Icon symbol="github" />Github</Button>
</Story>
<Story name="Primary with icon on right">
<Button right href="https://google.com">Github<Icon symbol="github" /></Button>
</Story>
<!-- Secondary -->
<Story name="Secondary">
<Button type="secondary" href="https://google.com">Github</Button>
</Story>
<Story name="Secondary with icon on left">
<Button left type="secondary" href="https://google.com"
><Icon symbol="github" type="dark" />Github</Button>
</Story>
<Story name="Secondary with icon on right">
<Button right type="secondary" href="https://google.com"
>Github<Icon symbol="github" type="dark" /></Button>
</Story>

@ -0,0 +1,35 @@
<script>
/**
* @type {string} Link
*/
export let href = '';
/**
* @type {boolean} Style button for icon on left
*/
export let left = false;
/**
* @type {boolean} Style button for icon on right
*/
export let right = false;
/**
* Specify the kind of icon
* @type {'primary' | 'secondary' }
*/
export let type = 'primary';
$: xPadding = left ? 'pl-6 pr-8' : right ? 'pr-6 pl-8' : 'px-8';
$: typeCoding =
type === 'primary'
? 'bg-svelte-600 text-white hover:bg-svelte-700'
: 'border border-slate-600 text-slate-600 hover:bg-slate-200';
</script>
<a
class={`inline-block rounded-lg py-3 text-lg font-semibold leading-6 ${xPadding} ${typeCoding}`}
{href}
target="_blank"
rel="noreferrer">
<div class="flex items-center gap-2">
<slot />
</div>
</a>

@ -0,0 +1,12 @@
<script>
import {Meta, Story} from '@storybook/addon-svelte-csf';
import H1 from './H1.svelte';
</script>
<Meta title="Design System/Atoms/H1" component={H1} />
<!-- Primary -->
<Story name="Primary">
<H1>Svelte Starter Kit</H1>
</Story>

@ -0,0 +1 @@
<h1 class="text-6xl font-bold text-slate-700"><slot /></h1>

@ -0,0 +1,26 @@
<script>
import {Meta, Story} from '@storybook/addon-svelte-csf';
import Icon from './Icon.svelte';
</script>
<Meta title="Design System/Atoms/Icon" component={Icon} />
<!-- Light -->
<Story name="Github - Light">
<Icon symbol="github" />
</Story>
<Story name="Github - Dark">
<Icon type="dark" symbol="github" />
</Story>
<!-- Symbols -->
<Story name="Star - Dark">
<Icon type="dark" symbol="star" />
</Story>
<Story name="Fork - Dark">
<Icon type="dark" symbol="fork" />
</Story>
<Story name="Link - Dark">
<Icon type="dark" symbol="link" />
</Story>

@ -0,0 +1,68 @@
<script>
/**
* Specify the kind of icon
* @type {'github' | 'star' | 'fork' | 'link'}
*/
export let symbol = 'github';
/**
* Specify the kind of icon
* @type {'light' | 'dark' }
*/
export let type = 'light';
$: typeCoding = type === 'light' ? 'stroke-white' : 'stroke-slate-600';
</script>
{#if symbol === 'github'}
<svg
class={`h-5 w-5 stroke-2 ${typeCoding}`}
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24">
<g clip-path="url(#a)">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" />
</g>
<defs>
<clipPath id="a">
<path d="M0 0h24v24H0z" />
</clipPath>
</defs>
</svg>
{:else if symbol === 'star'}
<svg
class={`h-5 w-5 stroke-2 ${typeCoding}`}
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M12.951 2.927c-.299-.92-1.602-.92-1.902 0L9.53 7.601a1 1 0 0 1-.95.69H3.664c-.968 0-1.372 1.24-.588 1.81l3.976 2.888a1 1 0 0 1 .363 1.118l-1.518 4.674c-.3.921.755 1.688 1.538 1.118l3.976-2.888a1 1 0 0 1 1.176 0l3.976 2.888c.783.57 1.838-.196 1.538-1.118l-1.518-4.674a1 1 0 0 1 .363-1.118l3.976-2.888c.783-.57.381-1.81-.588-1.81H15.42a1 1 0 0 1-.95-.69l-1.519-4.674Z" />
</svg>
{:else if symbol === 'fork'}
<svg
class={`h-5 w-5 stroke-2 ${typeCoding}`}
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M18 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 9v12m7-15h3a2 2 0 0 1 2 2v7M6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" />
</svg>
{:else if symbol === 'link'}
<svg
class={`h-5 w-5 stroke-2 ${typeCoding}`}
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M10 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4M14 4h6m0 0v6m0-6L10 14" />
</svg>
{/if}

@ -0,0 +1,12 @@
<script>
import {Meta, Story} from '@storybook/addon-svelte-csf';
import Pill from './Pill.svelte';
</script>
<Meta title="Design System/Atoms/Pill" component={Pill} />
<!-- Light -->
<Story name="Pill -Light">
<Pill>Svelte + TailwindCSS + Storybook</Pill>
</Story>

@ -0,0 +1,4 @@
<div
class="inline-block rounded-full bg-svelte-100 px-5 py-1 text-sm font-semibold uppercase leading-6 text-svelte-800">
<slot />
</div>

@ -0,0 +1,108 @@
import {Meta} from '@storybook/blocks';
import Social from '../assets/social.jpg';
<Meta title="Intro/Welcome" />
# Svelte 3.5 + Storybook 7 + TailwindCSS 3
<img src={Social} alt="Svelte + Storybook + TailwindCSS" />
Visit the website to see the outcome: [Svelte + Storybook + TailwindCSS](https://sst.sveltehub.dev)
```bash
// Quickstart
npx degit jerriclynsjohn/svelte-storybook-tailwind my-svelte-project
cd my-svelte-project
npm
npm run dev
npm run storybook
```
This has improved a lot since I started this repo, but I feel that there is still a need to just clone the repo and kickstart the project, so here I am again updating this and I'll keep this repo updated. I also feel that there is a need for a repo which shows some best practices.
> You can easily start your project with this template, instead of wasting time figuring out configurations for each integration.
[Storybook](https://storybook.js.org/) is an open source tool for developing JavaScript UI components in isolation
[Svelte](https://svelte.dev/) is a component framework that allows you to write highly-efficient, imperative code, that surgically updates the DOM to maintain performance.
[TailwindCSS](https://tailwindcss.com/) is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override.
## Steps to build
#### Instantiate Svelte + Vite app
- Initiate the project using `npm create vite@latest`
- Select Svelte + Javascript from the CLI
- You have a basic Svelte + Vite app ready
#### Add Tailwind to the project
- Install dependencies `npm install -D tailwindcss postcss autoprefixer`
- Instantiate the tailwind and postcss config files using `npx tailwindcss init -p`
- Update the tailwind config as shown below to accomodate for Svelte components
```js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./index.html', './src/**/*.{svelte,js,ts}'],
theme: {
extend: {}
},
plugins: []
};
``;
```
- Add Tailwind directive to your CSS at `./src/index.css`
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```
- Import CSS into `./src/main.js`
```js
import './index.css';
import App from './App.svelte';
const app = new App({
target: document.getElementById('app')
});
export default app;
```
- With this we have tailwind setup in the project
#### Add storybook and native story format into the project
- Instantiate by running `npx storybook@next init`
- Hook up TailwindCSS by importing the CSS into `./.storybook/preview.js`
```js
import '../src/index.css';
export const parameters = {
backgrounds: {
default: 'light'
},
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
}
};
```
- This completes the setup required for the project
### Best Practices for UI Component Library
- Watchout for this space for more, will be updatin with some good best practises till then do feel free to explore the example UI components used for this website.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save