diff --git a/package.json b/package.json
index 65126997..596e8028 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@soramitsu/soramitsu-js-ui",
- "version": "0.3.2",
+ "version": "0.3.3",
"private": false,
"publishConfig": {
"registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/"
diff --git a/src/components/Button/SButton.vue b/src/components/Button/SButton.vue
index f8763a34..ce9ee5ff 100644
--- a/src/components/Button/SButton.vue
+++ b/src/components/Button/SButton.vue
@@ -1,5 +1,5 @@
-
+
).includes(this.type)) {
+ if (([ButtonTypes.LINK, ButtonTypes.ACTION] as Array).includes(this.type)) {
return false
}
return this.loading
@@ -220,11 +227,12 @@ export default class SButton extends Vue {
&:disabled, &:disabled:hover {
color: $color-neutral-inactive;
border-color: $color-neutral-border;
+ background-color: $color-basic-white;
}
}
}
-.tertiary {
+.link {
color: $color-basic-black;
border: none;
background-color: transparent;
@@ -237,6 +245,22 @@ export default class SButton extends Vue {
}
}
+.tertiary {
+ color: $color-basic-black;
+ border-color: $color-neutral-placeholder;
+ background-color: $color-neutral-placeholder;
+ &:hover, &:active, &:focus {
+ color: $color-main-brand;
+ background-color: $color-neutral-placeholder;
+ border-color: $color-neutral-placeholder;
+ }
+ &:disabled, &:disabled:hover {
+ color: $color-neutral-inactive;
+ background-color: $color-neutral-placeholder;
+ border-color: $color-neutral-placeholder;
+ }
+}
+
.action {
&.big {
width: $size-big;
diff --git a/src/components/Button/consts.ts b/src/components/Button/consts.ts
index 78f1e9da..4599450b 100644
--- a/src/components/Button/consts.ts
+++ b/src/components/Button/consts.ts
@@ -4,7 +4,8 @@ export enum ButtonTypes {
PRIMARY = 'primary',
SECONDARY = 'secondary',
TERTIARY = 'tertiary',
- ACTION = 'action'
+ ACTION = 'action',
+ LINK = 'link'
}
export enum ButtonNativeTypes {
diff --git a/src/components/Checkbox/SCheckbox.vue b/src/components/Checkbox/SCheckbox.vue
index 0fdcfdb4..8c85714a 100644
--- a/src/components/Checkbox/SCheckbox.vue
+++ b/src/components/Checkbox/SCheckbox.vue
@@ -176,8 +176,11 @@ export default class SCheckbox extends Vue {
}
}
&.is-checked {
- &.is-disabled > .el-checkbox__inner::after {
- border-color: $color-neutral-inactive;
+ &.is-disabled > .el-checkbox__inner {
+ background-color: $color-neutral-placeholder;
+ &::after {
+ border-color: $color-neutral-inactive;
+ }
}
& + .el-checkbox__label {
color: $color-basic-black;
diff --git a/src/components/DatePicker/SDatePicker.vue b/src/components/DatePicker/SDatePicker.vue
index b87f50b9..316fa2a3 100644
--- a/src/components/DatePicker/SDatePicker.vue
+++ b/src/components/DatePicker/SDatePicker.vue
@@ -26,6 +26,7 @@
:validate-event="validateEvent"
@blur="handleBlur"
@focus="handleFocus"
+ @change="handleChange"
>
@@ -180,6 +181,7 @@ export default class SDatePicker extends Vue {
@Watch('value')
private handlePropChange (value: any): void {
this.model = value
+ this.focused = false
}
@Watch('model')
@@ -241,6 +243,10 @@ export default class SDatePicker extends Vue {
this.$emit('focus', component)
}
+ handleChange (values: any): void {
+ this.focused = false
+ }
+
public focus (): void {
this.picker.focus()
}
@@ -351,6 +357,14 @@ export default class SDatePicker extends Vue {
}
}
}
+ .s-icon-chevron-bottom {
+ position: absolute;
+ right: 10px;
+ top: 30%;
+ pointer-events: none;
+ color: $color-neutral-tertiary;
+ transition: transform .3s;
+ }
&.focused {
.el-date-editor.el-input__inner,
.el-date-editor .el-input__inner {
@@ -360,14 +374,6 @@ export default class SDatePicker extends Vue {
transform: rotate(180deg);
}
}
- .s-icon-chevron-bottom {
- position: absolute;
- right: 10px;
- top: 30%;
- pointer-events: none;
- color: $color-neutral-tertiary;
- transition: transform .3s;
- }
&.has-value {
.s-icon-chevron-bottom {
color: $color-basic-black;
diff --git a/src/components/Dropdown/SDropdown.vue b/src/components/Dropdown/SDropdown.vue
index 276436f2..bd0e5064 100644
--- a/src/components/Dropdown/SDropdown.vue
+++ b/src/components/Dropdown/SDropdown.vue
@@ -28,12 +28,12 @@
-
+
-
+
@@ -47,10 +47,12 @@ import { ElDropdown } from 'element-ui/types/dropdown'
import { DropdownType, DropdownSize, DropdownPlacement, DropdownTrigger } from './consts'
import { ButtonTypes, SButton } from '../Button'
+import { STooltip } from '../Tooltip'
@Component({
components: {
- SButton
+ SButton,
+ STooltip
}
})
export default class SDropdown extends Vue {
diff --git a/src/components/Form/SFormItem.vue b/src/components/Form/SFormItem.vue
index 7fc292a5..1c7f347c 100644
--- a/src/components/Form/SFormItem.vue
+++ b/src/components/Form/SFormItem.vue
@@ -13,7 +13,7 @@
>
-
+
@@ -89,6 +89,10 @@ export default class SFormItem extends Vue {
})
}
+ get willMessageBeShown (): boolean {
+ return this.showMessage && (this.elForm || {}).showMessage
+ }
+
get computedRules (): object {
const rules = (this.rules || (this.elForm.rules || {})[this.prop]) as any
if (!rules) {
diff --git a/src/components/Radio/SRadio.vue b/src/components/Radio/SRadio.vue
new file mode 100644
index 00000000..19ded97c
--- /dev/null
+++ b/src/components/Radio/SRadio.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Radio/consts.ts b/src/components/Radio/consts.ts
new file mode 100644
index 00000000..63f35931
--- /dev/null
+++ b/src/components/Radio/consts.ts
@@ -0,0 +1,3 @@
+import { Size } from '../../types'
+
+export const RadioSize = Size
diff --git a/src/components/Radio/index.ts b/src/components/Radio/index.ts
new file mode 100644
index 00000000..ec804fcd
--- /dev/null
+++ b/src/components/Radio/index.ts
@@ -0,0 +1,4 @@
+import SRadio from './SRadio.vue'
+import { RadioSize } from './consts'
+
+export { SRadio, RadioSize }
diff --git a/src/components/Tooltip/STooltip.vue b/src/components/Tooltip/STooltip.vue
index 4b65cc01..1cd77a70 100644
--- a/src/components/Tooltip/STooltip.vue
+++ b/src/components/Tooltip/STooltip.vue
@@ -1,5 +1,6 @@
diff --git a/src/components/index.ts b/src/components/index.ts
index e6622472..24ea6d52 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -22,6 +22,7 @@ import { SInput, SJsonInput } from './Input'
import { SMain } from './Layout/Main'
import { SMenu, SMenuItem, SMenuItemGroup, SSubmenu } from './Menu'
import { SPagination } from './Pagination'
+import { SRadio } from './Radio'
import { SRow } from './Layout/Row'
import { SScrollSectionItem, SScrollSections } from './ScrollSections'
import { SSelect, SOption, SOptionGroup } from './Select'
@@ -61,6 +62,7 @@ export {
SOption,
SOptionGroup,
SPagination,
+ SRadio,
SRow,
SScrollSectionItem,
SScrollSections,
diff --git a/src/index.ts b/src/index.ts
index e8d3487e..ba537aae 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -32,6 +32,7 @@ import {
SOption,
SOptionGroup,
SPagination,
+ SRadio,
SRow,
SScrollSectionItem,
SScrollSections,
@@ -80,6 +81,7 @@ const components = [
{ component: SOption, name: Components.SOption },
{ component: SOptionGroup, name: Components.SOptionGroup },
{ component: SPagination, name: Components.SPagination },
+ { component: SRadio, name: Components.SRadio },
{ component: SRow, name: Components.SRow },
{ component: SScrollSectionItem, name: Components.SScrollSectionItem },
{ component: SScrollSections, name: Components.SScrollSections },
@@ -144,6 +146,7 @@ export {
SPagination,
SOption,
SOptionGroup,
+ SRadio,
SRow,
SScrollSectionItem,
SScrollSections,
diff --git a/src/stories/Radio/SRadio.stories.ts b/src/stories/Radio/SRadio.stories.ts
new file mode 100644
index 00000000..26d2b470
--- /dev/null
+++ b/src/stories/Radio/SRadio.stories.ts
@@ -0,0 +1,91 @@
+import { withKnobs, select, boolean } from '@storybook/addon-knobs'
+
+import { SRadio, SRow, SCol } from '../../components'
+import { RadioSize } from '../../components/Radio'
+
+export default {
+ component: SRadio,
+ title: 'Design System/Radio',
+ decorators: [withKnobs],
+ excludeStories: /.*Data$/
+}
+
+export const radioData = [
+ { label: 'first', title: 'First' },
+ { label: 'second', title: 'Second' }
+]
+
+export const configurable = () => ({
+ components: { SRadio, SRow, SCol },
+ template: `
+
+ changeValue = value"
+ >
+ {{ item.title }}
+
+
+
+ v-model="{{ vModelValue }}", @change="{{ changeValue }}"
+
+ `,
+ data: () => ({
+ vModelValue: 'first',
+ changeValue: '',
+ items: radioData
+ }),
+ props: {
+ size: {
+ default: select('Size', Object.values(RadioSize), RadioSize.MEDIUM)
+ },
+ disabled: {
+ default: boolean('Disabled', false)
+ },
+ border: {
+ default: boolean('Border', false)
+ }
+ }
+})
+
+export const disabled = () => ({
+ components: { SRadio, SRow },
+ template: `
+
+ {{ item.title }}
+
+ `,
+ data: () => ({
+ model: 'first',
+ items: radioData
+ })
+})
+
+export const withBorders = () => ({
+ components: { SRadio, SRow },
+ template: `
+
+ {{ item.title }}
+
+ `,
+ data: () => ({
+ model: 'first',
+ items: radioData
+ })
+})
diff --git a/src/stories/SButton.stories.ts b/src/stories/SButton.stories.ts
index c491af8c..8a209eae 100644
--- a/src/stories/SButton.stories.ts
+++ b/src/stories/SButton.stories.ts
@@ -146,12 +146,12 @@ export const withIcon = () => ({
components: { SButton, SRow, SCol, SMain },
template: `
-
+
{{ item.label }}
-
+
{{ item.label }}
diff --git a/src/stories/SCheckbox.stories.ts b/src/stories/SCheckbox.stories.ts
index 2c53d75f..069209e7 100644
--- a/src/stories/SCheckbox.stories.ts
+++ b/src/stories/SCheckbox.stories.ts
@@ -50,16 +50,20 @@ export const disabled = () => ({
components: { SCheckbox, SRow, SCol },
template: `
-
+
Checkbox
-
+
Checkbox
- `
+ `,
+ data: () => ({
+ first: true,
+ second: false
+ })
})
export const differentSizeData = Object.values(CheckboxSize).map(size =>
@@ -69,12 +73,12 @@ export const differentSize = () => ({
template: `
-
+
{{ item.label }}
-
+
{{ item.label }}
diff --git a/src/types/components.ts b/src/types/components.ts
index 3b1a4701..3c4d1a20 100644
--- a/src/types/components.ts
+++ b/src/types/components.ts
@@ -30,6 +30,7 @@ export enum Components {
SOption = 'SOption',
SOptionGroup = 'SOptionGroup',
SPagination = 'SPagination',
+ SRadio = 'SRadio',
SRow = 'SRow',
SScrollSectionItem = 'SScrollSectionItem',
SScrollSections = 'SScrollSections',