diff --git a/src/components/Button/SButton.vue b/src/components/Button/SButton.vue
index e13ade1b..e03446f6 100644
--- a/src/components/Button/SButton.vue
+++ b/src/components/Button/SButton.vue
@@ -160,18 +160,6 @@ export default class SButton extends Vue {
}
}
-.big {
- height: $size-big;
-}
-
-.medium {
- height: $size-medium;
-}
-
-.small {
- height: $size-small;
-}
-
.primary {
&:hover, &:active, &:focus {
background-color: $color-main-hover;
diff --git a/src/components/Checkbox/SCheckbox.vue b/src/components/Checkbox/SCheckbox.vue
new file mode 100644
index 00000000..823ca3d4
--- /dev/null
+++ b/src/components/Checkbox/SCheckbox.vue
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Checkbox/consts.ts b/src/components/Checkbox/consts.ts
new file mode 100644
index 00000000..96554de5
--- /dev/null
+++ b/src/components/Checkbox/consts.ts
@@ -0,0 +1,3 @@
+import { Size } from '../../types/size'
+
+export const CheckboxSize = Size
diff --git a/src/components/Checkbox/index.ts b/src/components/Checkbox/index.ts
new file mode 100644
index 00000000..5f2acf9d
--- /dev/null
+++ b/src/components/Checkbox/index.ts
@@ -0,0 +1,4 @@
+import SCheckbox from './SCheckbox.vue'
+import { CheckboxSize } from './consts'
+
+export { SCheckbox, CheckboxSize }
diff --git a/src/components/ScrollSections/SScrollSections.vue b/src/components/ScrollSections/SScrollSections.vue
index 9248319a..0e293651 100644
--- a/src/components/ScrollSections/SScrollSections.vue
+++ b/src/components/ScrollSections/SScrollSections.vue
@@ -65,6 +65,10 @@ export default class SScrollSections extends Vue {
})
}
+ destroyed (): void {
+ window.removeEventListener('scroll', this.handleScroll)
+ }
+
get computedStyles (): object {
const styles = {} as any
if (this.textColor) {
diff --git a/src/components/index.ts b/src/components/index.ts
index 0da7b7bc..2e79c56f 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -5,6 +5,7 @@ import { SApp } from './Layout/App'
import { SAside } from './Layout/Aside'
import { SButton, SButtonGroup } from './Button'
import { SCard } from './Card'
+import { SCheckbox } from './Checkbox'
import { SCol } from './Layout/Col'
import { SContainer } from './Layout/Container'
import { SDropdown, SDropdownItem } from './Dropdown'
@@ -24,6 +25,7 @@ export {
SButton,
SButtonGroup,
SCard,
+ SCheckbox,
SCol,
SContainer,
SDropdown,
diff --git a/src/index.ts b/src/index.ts
index cfcf50c0..aa649e93 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -6,6 +6,7 @@ import {
SButton,
SButtonGroup,
SCard,
+ SCheckbox,
SCol,
SContainer,
SFooter,
@@ -32,6 +33,7 @@ const elements = [
{ component: SButton, name: Components.SButton },
{ component: SButtonGroup, name: Components.SButtonGroup },
{ component: SCard, name: Components.SCard },
+ { component: SCheckbox, name: Components.SCheckbox },
{ component: SCol, name: Components.SCol },
{ component: SContainer, name: Components.SContainer },
{ component: SFooter, name: Components.SFooter },
@@ -67,6 +69,7 @@ export {
SButton,
SButtonGroup,
SCard,
+ SCheckbox,
SCol,
SContainer,
SFooter,
diff --git a/src/stories/SCheckbox.stories.ts b/src/stories/SCheckbox.stories.ts
new file mode 100644
index 00000000..7556b584
--- /dev/null
+++ b/src/stories/SCheckbox.stories.ts
@@ -0,0 +1,81 @@
+import { text, withKnobs, select, boolean } from '@storybook/addon-knobs'
+
+import { SCheckbox, SRow, SCol } from '../components'
+import { CheckboxSize } from '../components/Checkbox'
+
+export default {
+ component: SCheckbox,
+ title: 'Design System/Checkbox',
+ decorators: [withKnobs],
+ excludeStories: /.*Data$/
+}
+
+export const configurable = () => ({
+ components: { SCheckbox, SRow },
+ template: `
+
+
+ `,
+ props: {
+ disabled: {
+ default: boolean('Disabled', false)
+ },
+ border: {
+ default: boolean('Border', false)
+ },
+ label: {
+ default: text('Label', 'Checkbox')
+ },
+ size: {
+ default: select('Size', Object.values(CheckboxSize), CheckboxSize.MEDIUM)
+ }
+ },
+ methods: {
+ hangleChange: (checked: boolean) => console.log(checked ? 'checked!' : 'unchecked!')
+ }
+})
+
+export const disabled = () => ({
+ components: { SCheckbox, SRow, SCol },
+ template: `
+
+
+ Checkbox
+
+
+
+
+ Checkbox
+
+
+ `
+})
+
+export const differentSizeData = Object.values(CheckboxSize).map(size =>
+ ({ size, label: size[0].toUpperCase() + size.slice(1) }))
+export const differentSize = () => ({
+ components: { SCheckbox, SRow, SCol },
+ template: `
+
+
+
+ {{ item.label }}
+
+
+
+
+ {{ item.label }}
+
+
+
+ `,
+ data: () => ({
+ items: differentSizeData
+ })
+})
diff --git a/src/styles/common.scss b/src/styles/common.scss
index 9a94f71c..4af8f59b 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -22,6 +22,18 @@ html {
font-weight: bold;
}
+.big {
+ height: $size-big;
+}
+
+.medium {
+ height: $size-medium;
+}
+
+.small {
+ height: $size-small;
+}
+
button > span {
position: relative;
}
diff --git a/src/types/components.ts b/src/types/components.ts
index 659eef9d..95934c03 100644
--- a/src/types/components.ts
+++ b/src/types/components.ts
@@ -4,6 +4,7 @@ export enum Components {
SButton = 'SButton',
SButtonGroup = 'SButtonGroup',
SCard = 'SCard',
+ SCheckbox = 'SCheckbox',
SCol= 'SCol',
SContainer = 'SContainer',
SFooter = 'SFooter',