diff --git a/.stories/Button/Button.svelte b/.stories/Button/Button.svelte index 2c52fe0..eed94d9 100644 --- a/.stories/Button/Button.svelte +++ b/.stories/Button/Button.svelte @@ -1,9 +1,9 @@ - +{/each} diff --git a/.stories/Button/Disabled.svelte b/.stories/Button/Disabled.svelte new file mode 100644 index 0000000..d37dfc2 --- /dev/null +++ b/.stories/Button/Disabled.svelte @@ -0,0 +1,5 @@ + + + diff --git a/.stories/Button/Icon.svelte b/.stories/Button/Icon.svelte new file mode 100644 index 0000000..0b250f0 --- /dev/null +++ b/.stories/Button/Icon.svelte @@ -0,0 +1,34 @@ + + +{#each colors as color} + +{/each} diff --git a/.stories/Button/Link.svelte b/.stories/Button/Link.svelte new file mode 100644 index 0000000..c0c1ef4 --- /dev/null +++ b/.stories/Button/Link.svelte @@ -0,0 +1,10 @@ + + +{#each colors as color} + +{/each} diff --git a/.stories/Button/Outline.svelte b/.stories/Button/Outline.svelte index c3beb58..15982f7 100644 --- a/.stories/Button/Outline.svelte +++ b/.stories/Button/Outline.svelte @@ -1,9 +1,9 @@ - +{/each} diff --git a/.stories/Button/RTL.svelte b/.stories/Button/RTL.svelte new file mode 100644 index 0000000..12ede35 --- /dev/null +++ b/.stories/Button/RTL.svelte @@ -0,0 +1,34 @@ + + +{#each colors as color} + +{/each} diff --git a/.stories/Button/Size.svelte b/.stories/Button/Size.svelte new file mode 100644 index 0000000..cafa7a4 --- /dev/null +++ b/.stories/Button/Size.svelte @@ -0,0 +1,39 @@ + + +{#each colors as color} + +{/each} +
+
+{#each colors as color} + +{/each} diff --git a/.stories/Button/index.svelte b/.stories/Button/index.svelte index 89c685c..0ca1aef 100644 --- a/.stories/Button/index.svelte +++ b/.stories/Button/index.svelte @@ -1,12 +1,32 @@ - - -

Colored button!

+

Buttons

+
+

Colors

+{#if href} + + {#if iconSlot} + + + + {/if} + + + + +{:else} + +{/if} diff --git a/package.json b/package.json index e8c522b..39f6b33 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "build:storybook": "build-storybook", "lint": "eslint --ext .js,.svelte,.html --ignore-path .gitignore .", "lint:fix": "yarn lint --fix", - "format": "prettier --write **/**/*.{svelte,js} **/*.{svelte,js} --ignore-path .gitignore" + "format": "prettier --write **/**/*.{svelte,js,scss} **/*.{svelte,js,scss} *.{svelte,js,scss} --ignore-path .gitignore" }, "files": [ "src", diff --git a/styles/_mixins.scss b/styles/_mixins.scss index e69de29..c43b782 100644 --- a/styles/_mixins.scss +++ b/styles/_mixins.scss @@ -0,0 +1,27 @@ +@mixin btn { + background: none; + border: none; + font: inherit; + cursor: pointer; + outline: inherit; + font-size: 14px; + line-height: 1.5; + border-radius: 3px; + padding: 0.625rem 0.75rem; + color: white; + font-family: inherit; + font-size: inherit; + font-weight: bold; + font-stretch: normal; + font-style: normal; + line-height: normal; + text-align: center; + position: relative; + transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); + @include center-horizontally(); +} +@mixin center-horizontally { + display: inline-flex; + justify-content: center; + align-items: center; +} diff --git a/styles/_variables.scss b/styles/_variables.scss index e69de29..0ea9a4c 100644 --- a/styles/_variables.scss +++ b/styles/_variables.scss @@ -0,0 +1,21 @@ +$primary: #2979ff; +$success: #43a047; +$danger: #f44336; +$warning: #ff9800; +$white: #ffffff; + +$primary-hover: #0069d9; +$primary-hover-border-color: #0062cc; + +$success-hover: #218838; +$success-hover-border-color: #1e7e34; + +$warning-hover: #fda624; +$warning-hover-border-color: #f6bd13; + +$danger-hover: #df2b1e; +$danger-hover-border-color: #ec554a; + +$primary-text: #526576; + +$focus-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); diff --git a/utils.js b/utils.js new file mode 100644 index 0000000..8473310 --- /dev/null +++ b/utils.js @@ -0,0 +1,9 @@ +export function getProps($$props) { + const props = {} + Object.keys($$props).map(prop => { + if (prop !== 'children' && prop !== '$$scope' && prop !== '$$slots') { + props[prop] = $$props[prop] + } + }) + return props +}