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 colors as color}
+
+{/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 colors as color}
+
+{/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
-Simple button!
+Outline
+
+Icon
+
+
+Size
+
+
+Disabled
+
+
+Link
+
+
+RTL
+
diff --git a/.stories/index.stories.js b/.stories/index.stories.js
index 2c1f2be..3f12abf 100644
--- a/.stories/index.stories.js
+++ b/.stories/index.stories.js
@@ -5,4 +5,4 @@ const story = Component => () => ({
Component,
})
-storiesOf('Components', module).add('Button Component', story(Button))
+storiesOf('Components', module).add('Button', story(Button))
diff --git a/Button/Button.scss b/Button/Button.scss
new file mode 100644
index 0000000..7bd3b17
--- /dev/null
+++ b/Button/Button.scss
@@ -0,0 +1,144 @@
+@import '../styles/variables.scss';
+@import '../styles/mixins.scss';
+
+.btn {
+ --bg-color: $primary;
+ @include btn();
+
+ &-primary {
+ background-color: $primary;
+ border: 1px solid $primary;
+ &:not([disabled]):hover {
+ background-color: $primary-hover;
+ border-color: $primary-hover-border-color;
+ color: $white;
+ }
+ &:not([disabled]):active,
+ &:not([disabled]):focus {
+ background-color: $primary-hover;
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
+ color: $white;
+ }
+ }
+ &-success {
+ background-color: $success;
+ border: 1px solid $success;
+ &:not([disabled]):hover {
+ background-color: $success-hover;
+ border-color: $success-hover-border-color;
+ color: $white;
+ }
+ &:not([disabled]):active,
+ &:not([disabled]):focus {
+ background-color: $success-hover;
+ box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
+ color: $white;
+ }
+ }
+ &-danger {
+ background-color: $danger;
+ border: 1px solid $danger;
+ &:not([disabled]):hover {
+ background-color: $danger-hover;
+ border-color: $danger-hover-border-color;
+ color: $white;
+ }
+ &:not([disabled]):active,
+ &:not([disabled]):focus {
+ background-color: $danger-hover;
+ box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
+ color: $white;
+ }
+ }
+ &-warning {
+ background-color: $warning;
+ border: 1px solid $warning;
+ &:not([disabled]):hover {
+ background-color: $warning-hover;
+ border-color: $warning-hover-border-color;
+ color: $white;
+ }
+ &:not([disabled]):active,
+ &:not([disabled]):focus {
+ background-color: $warning-hover;
+ box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
+ color: $white;
+ }
+ }
+ &-outline-primary {
+ background: none;
+ border: 1px solid $primary;
+ color: $primary;
+ }
+ &-outline-danger {
+ background: none;
+ border: 1px solid $danger;
+ color: $danger;
+ }
+ &-outline-success {
+ background: none;
+ border: 1px solid $success;
+ color: $success;
+ }
+ &-outline-warning {
+ background: none;
+ border: 1px solid $warning;
+ color: $warning;
+ }
+ &-block {
+ display: block;
+ width: 100%;
+ }
+ &-size-md {
+ min-width: 340px;
+ }
+ &-size-sm {
+ min-width: 164px;
+ }
+
+ &-size-lg {
+ min-width: 640px;
+ }
+ .icon {
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ background-color: var(--bg-color);
+ margin-inline-end: 4px;
+ @include center-horizontally();
+ }
+ &.btn-size-md.ltr .icon,
+ &.btn-size-lg.ltr .icon {
+ position: absolute;
+ left: 5%;
+ top: 50%;
+ transform: translateY(-50%);
+ }
+ &.btn-size-md.rtl .icon,
+ &.btn-size-lg.rtl .icon {
+ position: absolute;
+ right: 5%;
+ top: 50%;
+ transform: translateY(-50%);
+ }
+}
+a {
+ text-decoration: none;
+}
+button:disabled,
+a.disabled {
+ background-color: rgba(0, 0, 0, 0.12);
+ color: rgba(0, 0, 0, 0.26);
+ pointer-events: none;
+ cursor: default;
+ border: none;
+ &:hover {
+ background-color: none;
+ color: none;
+ box-shadow: none;
+ }
+}
+span.icon :global(*) {
+ max-width: 16px;
+ max-height: 16px;
+}
diff --git a/Button/Button.svelte b/Button/Button.svelte
index d6d4adc..991b9eb 100644
--- a/Button/Button.svelte
+++ b/Button/Button.svelte
@@ -1,18 +1,59 @@
-
+{#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
+}