diff --git a/package.json b/package.json
index 4e9721d3..412e29fe 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@soramitsu/soramitsu-js-ui",
- "version": "0.2.7",
+ "version": "0.2.8",
"private": false,
"publishConfig": {
"registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/"
diff --git a/src/assets/fonts/soramitsu-icons.woff b/src/assets/fonts/soramitsu-icons.woff
new file mode 100644
index 00000000..d7fe06f0
Binary files /dev/null and b/src/assets/fonts/soramitsu-icons.woff differ
diff --git a/src/assets/icons/activity.svg b/src/assets/icons/activity.svg
deleted file mode 100644
index f0c76a4a..00000000
--- a/src/assets/icons/activity.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/src/assets/icons/arrow-left.svg b/src/assets/icons/arrow-left.svg
deleted file mode 100644
index 13216e69..00000000
--- a/src/assets/icons/arrow-left.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/src/assets/icons/arrow-top.svg b/src/assets/icons/arrow-top.svg
deleted file mode 100644
index 2436d0c7..00000000
--- a/src/assets/icons/arrow-top.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/create.svg b/src/assets/icons/create.svg
deleted file mode 100644
index 0ef0864d..00000000
--- a/src/assets/icons/create.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/src/assets/icons/email.svg b/src/assets/icons/email.svg
deleted file mode 100644
index eb67d2e9..00000000
--- a/src/assets/icons/email.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/file-upload.svg b/src/assets/icons/file-upload.svg
deleted file mode 100644
index 60eac80c..00000000
--- a/src/assets/icons/file-upload.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/globe.svg b/src/assets/icons/globe.svg
deleted file mode 100644
index bdaaf594..00000000
--- a/src/assets/icons/globe.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/src/assets/icons/link-off.svg b/src/assets/icons/link-off.svg
deleted file mode 100644
index c9aebc1f..00000000
--- a/src/assets/icons/link-off.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/link-on.svg b/src/assets/icons/link-on.svg
deleted file mode 100644
index bd161522..00000000
--- a/src/assets/icons/link-on.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/log-out.svg b/src/assets/icons/log-out.svg
deleted file mode 100644
index 98cfd13c..00000000
--- a/src/assets/icons/log-out.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/assets/icons/more-horizontal.svg b/src/assets/icons/more-horizontal.svg
deleted file mode 100644
index dc1ec966..00000000
--- a/src/assets/icons/more-horizontal.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/play.svg b/src/assets/icons/play.svg
deleted file mode 100644
index 6d53a8df..00000000
--- a/src/assets/icons/play.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/plus.svg b/src/assets/icons/plus.svg
deleted file mode 100644
index 4977f632..00000000
--- a/src/assets/icons/plus.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/refresh-red.svg b/src/assets/icons/refresh-red.svg
deleted file mode 100644
index d4db0de1..00000000
--- a/src/assets/icons/refresh-red.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/assets/icons/refresh.svg b/src/assets/icons/refresh.svg
deleted file mode 100644
index 3c460cf8..00000000
--- a/src/assets/icons/refresh.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/assets/icons/stop.svg b/src/assets/icons/stop.svg
deleted file mode 100644
index 44135c3e..00000000
--- a/src/assets/icons/stop.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/src/assets/icons/warning.svg b/src/assets/icons/warning.svg
deleted file mode 100644
index e8a57025..00000000
--- a/src/assets/icons/warning.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/src/components/Button/SButton.vue b/src/components/Button/SButton.vue
index 5622b21b..37513e00 100644
--- a/src/components/Button/SButton.vue
+++ b/src/components/Button/SButton.vue
@@ -13,7 +13,7 @@
:icon="elementIcon"
@click="handleClick"
>
-
+
@@ -24,11 +24,12 @@ import { Vue, Component, Prop, Inject } from 'vue-property-decorator'
import { ElForm } from 'element-ui/types/form'
import { ElFormItem } from 'element-ui/types/form-item'
+import { SIcon } from '../Icon'
import { STooltip } from '../Tooltip'
import { ButtonTypes, ButtonSize, ButtonNativeTypes } from './consts'
@Component({
- components: { STooltip }
+ components: { SIcon, STooltip }
})
export default class SButton extends Vue {
readonly ButtonTypes = ButtonTypes
@@ -138,9 +139,8 @@ export default class SButton extends Vue {
this.elementIcon = this.icon
return ''
}
- // TODO: add checks for invalid icons
this.elementIcon = ''
- return `s-icon-${this.icon}`
+ return this.icon
}
get isLoading (): boolean {
@@ -235,31 +235,60 @@ export default class SButton extends Vue {
.action {
&.big {
width: $size-big;
+ i {
+ font-size: 20px;
+ }
}
&.medium {
width: $size-medium;
+ i {
+ font-size: 18px;
+ }
}
&.small {
width: $size-small;
+ i {
+ font-size: 16px;
+ margin-left: -2px;
+ margin-top: -2px;
+ }
}
+ color: $color-basic-black;
background-color: $color-neutral-placeholder;
border-color: $color-neutral-placeholder;
&:hover, &:active, &:focus, &:disabled, &:disabled:hover {
+ color: $color-basic-black;
background-color: $color-neutral-hover;
border-color: $color-neutral-hover;
}
+ &:disabled, &:disabled:hover {
+ color: $color-neutral-inactive;
+ }
&.alternative {
background-color: $color-basic-white;
border-color: $color-neutral-border;
&:hover, &:active, &:focus, &:disabled, &:disabled:hover {
+ color: $color-basic-black;
background-color: $color-neutral-placeholder;
border-color: $color-neutral-placeholder;
}
+ &:disabled, &:disabled:hover {
+ color: $color-neutral-inactive;
+ }
}
}
-button > span > i {
- top: -10px;
- left: -10px;
+button {
+ > span > i {
+ &[class^=s-icon-], &[class^=el-icon-] {
+ display: inline-block;
+ color: inherit;
+ }
+ }
+ &:not(.action) > span > i {
+ &[class^=s-icon-], &[class^=el-icon-] {
+ margin-right: 6px;
+ }
+ }
}
diff --git a/src/components/Button/consts.ts b/src/components/Button/consts.ts
index 6105f843..78f1e9da 100644
--- a/src/components/Button/consts.ts
+++ b/src/components/Button/consts.ts
@@ -1,4 +1,4 @@
-import { Size } from '../../types/size'
+import { Size } from '../../types'
export enum ButtonTypes {
PRIMARY = 'primary',
diff --git a/src/components/Checkbox/consts.ts b/src/components/Checkbox/consts.ts
index 96554de5..f7d55fd0 100644
--- a/src/components/Checkbox/consts.ts
+++ b/src/components/Checkbox/consts.ts
@@ -1,3 +1,3 @@
-import { Size } from '../../types/size'
+import { Size } from '../../types'
export const CheckboxSize = Size
diff --git a/src/components/Collapse/SCollapse.vue b/src/components/Collapse/SCollapse.vue
index d1feb8db..7d16c283 100644
--- a/src/components/Collapse/SCollapse.vue
+++ b/src/components/Collapse/SCollapse.vue
@@ -2,6 +2,7 @@
@@ -9,7 +10,7 @@
diff --git a/src/components/Divider/SDivider.vue b/src/components/Divider/SDivider.vue
new file mode 100644
index 00000000..6517e44c
--- /dev/null
+++ b/src/components/Divider/SDivider.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Divider/consts.ts b/src/components/Divider/consts.ts
new file mode 100644
index 00000000..10f7624d
--- /dev/null
+++ b/src/components/Divider/consts.ts
@@ -0,0 +1,9 @@
+import { Direction } from '../../types'
+
+export enum ContentPosition {
+ LEFT = 'left',
+ RIGHT = 'right',
+ CENTER = 'center'
+}
+
+export const DividerDirection = Direction
diff --git a/src/components/Divider/index.ts b/src/components/Divider/index.ts
new file mode 100644
index 00000000..7426c29d
--- /dev/null
+++ b/src/components/Divider/index.ts
@@ -0,0 +1,3 @@
+import SDivider from './SDivider.vue'
+
+export { SDivider }
diff --git a/src/components/Dropdown/SDropdown.vue b/src/components/Dropdown/SDropdown.vue
index 9483244e..276436f2 100644
--- a/src/components/Dropdown/SDropdown.vue
+++ b/src/components/Dropdown/SDropdown.vue
@@ -29,7 +29,7 @@
-
+
@@ -222,9 +222,8 @@ export default class SDropdown extends Vue {
> i {
cursor: pointer;
}
-}
-.ellipsis.el-popper[x-placement^=bottom] {
- margin-top: 25px;
- margin-left: 12px;
+ .s-icon-more-horizontal {
+ font-size: 24px;
+ }
}
diff --git a/src/components/Dropdown/consts.ts b/src/components/Dropdown/consts.ts
index c6d7fb5f..8fd34a23 100644
--- a/src/components/Dropdown/consts.ts
+++ b/src/components/Dropdown/consts.ts
@@ -1,4 +1,4 @@
-import { Size } from '../../types/size'
+import { Size } from '../../types'
export enum DropdownType {
DEFAULT = 'default',
diff --git a/src/components/Form/SFormItem.vue b/src/components/Form/SFormItem.vue
index 1c286c97..7fc292a5 100644
--- a/src/components/Form/SFormItem.vue
+++ b/src/components/Form/SFormItem.vue
@@ -179,9 +179,10 @@ export default class SFormItem extends Vue {
}
.s-icon-error {
position: absolute;
- width: 21px;
- height: 21px;
- background-position: 4px bottom;
+ bottom: 0;
+ left: 4px;
+ font-size: 16px;
+ color: $color-error;
}
}
}
diff --git a/src/components/Form/consts.ts b/src/components/Form/consts.ts
index 722d430f..0b7baf42 100644
--- a/src/components/Form/consts.ts
+++ b/src/components/Form/consts.ts
@@ -1,4 +1,4 @@
-import { Size } from '../../types/size'
+import { Size } from '../../types'
export enum LabelPosition {
LEFT = 'left',
diff --git a/src/components/Icon/SIcon.vue b/src/components/Icon/SIcon.vue
new file mode 100644
index 00000000..67103ad3
--- /dev/null
+++ b/src/components/Icon/SIcon.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
diff --git a/src/components/Icon/consts.ts b/src/components/Icon/consts.ts
new file mode 100644
index 00000000..c8537cb3
--- /dev/null
+++ b/src/components/Icon/consts.ts
@@ -0,0 +1,155 @@
+export enum Icons {
+ Back = 'back',
+ Warning = 'warning',
+ Error = 'error',
+ Logout = 'logout',
+ Create = 'create',
+ Refresh = 'refresh',
+ Activity = 'activity',
+ Play = 'play',
+ Stop = 'stop',
+ BarChart = 'bar-chart',
+ Book = 'book',
+ BookmarkAdd = 'bookmark-add',
+ BookmarkNo = 'bookmark-no',
+ Bookmark = 'bookmark',
+ Bookmarks = 'bookmarks',
+ Box = 'box',
+ BrowserNo = 'browser-no',
+ Browser = 'browser',
+ Brush = 'brush',
+ Calculator = 'calculator',
+ CameraCreate = 'camera-create',
+ CameraNo = 'camera-no',
+ Camera = 'camera',
+ Case = 'case',
+ CheckMark = 'check-mark',
+ CheckMarks = 'check-marks',
+ CircleBlock = 'circle-block',
+ CircleChecked = 'circle-checked',
+ CircleMenu = 'circle-menu',
+ CircleMinus = 'circle-minus',
+ CircleMoreHorizontal = 'circle-more-horizontal',
+ CircleMoreVertical = 'circle-more-vertical',
+ CirclePlus = 'circle-plus',
+ CircleStar = 'circle-star',
+ CircleX = 'circle-x',
+ Circle = 'circle',
+ ClearStyle = 'clear-style',
+ Copy = 'copy',
+ Cut = 'cut',
+ Dashboard = 'dashboard',
+ Delete = 'delete',
+ DownloadBold = 'download-bold',
+ Download = 'download',
+ Drop = 'drop',
+ ExternalLink = 'external-link',
+ EyeNo = 'eye-no',
+ Eye = 'eye',
+ Flag = 'flag',
+ Flame = 'flame',
+ Glasses = 'glasses',
+ GlobeNo = 'globe-no',
+ Globe = 'globe',
+ HeartNo = 'heart-no',
+ Heart = 'heart',
+ Home = 'home',
+ Image = 'image',
+ Inbox = 'inbox',
+ Layers = 'layers',
+ LightningNo = 'lightning-no',
+ Lightning = 'lightning',
+ LinkNo = 'link-no',
+ Link = 'link',
+ List = 'list',
+ Mail = 'mail',
+ Maximize = 'maximize',
+ MenuDots = 'menu-dots',
+ Menu = 'menu',
+ MicNo = 'mic-no',
+ Mic = 'mic',
+ Minimize = 'minimize',
+ Minus = 'minus',
+ MoreHorizontal = 'more-horizontal',
+ MoreVertical = 'more-vertical',
+ Newspaper = 'newspaper',
+ Options = 'options',
+ PaperclipNo = 'paperclip-no',
+ Paperclip = 'paperclip',
+ PencilCreate = 'pencil-create',
+ PencilEdit = 'pencil-edit',
+ Plus = 'plus',
+ Presentation = 'presentation',
+ Printer = 'printer',
+ Pulse = 'pulse',
+ Scan = 'scan',
+ Screenshot = 'screenshot',
+ Search = 'search',
+ Send = 'send',
+ Settings = 'settings',
+ ShareArrow = 'share-arrow',
+ Share = 'share',
+ StarNo = 'star-no',
+ Star = 'star',
+ Sticker = 'sticker',
+ table = 'table',
+ TextAlignCenter = 'text-align-center',
+ TextAlignJustify = 'text-align-justify',
+ TextAlignLeft = 'text-align-left',
+ TextAlignRight = 'text-align-right',
+ TextBgcolor = 'text-bgcolor',
+ TextBold = 'text-bold',
+ TextColor = 'text-color',
+ TextItalic = 'text-italic',
+ TextUnderline = 'text-underline',
+ ThumbsDown = 'thumbs-down',
+ ThumbsUp = 'thumbs-up',
+ ToggleLeft = 'toggle-left',
+ ToggleRight = 'toggle-right',
+ TrashEmpty = 'trash-empty',
+ Trash = 'trash',
+ User = 'user',
+ VideoNo = 'video-no',
+ Video = 'video',
+ ZoomIn = 'zoom-in',
+ ZoomOut = 'zoom-out',
+ ArrowBottomLeft = 'arrow-bottom-left',
+ ArrowBottomRight = 'arrow-bottom-right',
+ ArrowBottom = 'arrow-bottom',
+ ArrowLeft = 'arrow-left',
+ ArrowRight = 'arrow-right',
+ ArrowTopLeft = 'arrow-top-left',
+ ArrowTopRight = 'arrow-top-right',
+ ArrowTop = 'arrow-top',
+ Calendar = 'calendar',
+ CallPhone = 'call-phone',
+ ChevronBottom = 'chevron-bottom',
+ ChevronLeft = 'chevron-left',
+ ChevronRight = 'chevron-right',
+ ChevronTop = 'chevron-top',
+ ChevronsBottom = 'chevrons-bottom',
+ ChevronsLeft = 'chevrons-left',
+ ChevronsRight = 'chevrons-right',
+ CircleArrowBottom = 'circle-arrow-bottom',
+ CircleArrowLeft = 'circle-arrow-left',
+ CircleArrowRight = 'circle-arrow-right',
+ CircleArrowTop = 'circle-arrow-top',
+ CircleChevronBottom = 'circle-chevron-bottom',
+ CircleChevronLeft = 'circle-chevron-left',
+ CircleChevronRight = 'circle-chevron-right',
+ CircleChevronTop = 'circle-chevron-top',
+ CircleChevronsTop = 'circle-chevrons-top',
+ File = 'file',
+ FileUpload = 'file-upload',
+ Folder = 'folder',
+ Info = 'info',
+ Lock = 'lock',
+ PaperclipVertical = 'paperclip-vertical',
+ Pencil = 'pencil',
+ Pin = 'pin',
+ QuestionCircle = 'question-circle',
+ Target = 'target',
+ Time = 'time',
+ WiFi = 'wi-fi',
+ X = 'x'
+}
diff --git a/src/components/Icon/index.ts b/src/components/Icon/index.ts
new file mode 100644
index 00000000..03323d1c
--- /dev/null
+++ b/src/components/Icon/index.ts
@@ -0,0 +1,4 @@
+import SIcon from './SIcon.vue'
+import { Icons } from './consts'
+
+export { SIcon, Icons }
diff --git a/src/components/Input/SInput.vue b/src/components/Input/SInput.vue
index 8cf14ce6..5f8a87fc 100644
--- a/src/components/Input/SInput.vue
+++ b/src/components/Input/SInput.vue
@@ -29,7 +29,7 @@
@focus="handleFocus"
/>
-
+
@@ -121,8 +121,21 @@ export default class SInput extends Vue {
@Inject({ default: '', from: 'elForm' }) elForm!: ElForm
focused = false
+ autofill = false
model = this.value
+ mounted (): void {
+ this.$el.addEventListener('animationstart', this.changeAutofillValue)
+ }
+
+ destroyed (): void {
+ this.$el.removeEventListener('animationstart', this.changeAutofillValue)
+ }
+
+ private changeAutofillValue (e: any): void {
+ this.autofill = e.animationName === 'onAutoFillStart'
+ }
+
@Watch('value')
private handlePropChange (value: string | number): void {
this.model = value
@@ -153,6 +166,9 @@ export default class SInput extends Vue {
if (this.type === InputType.TEXT_FILE) {
cssClasses.push('text-file')
}
+ if (this.autofill) {
+ cssClasses.push('autofill')
+ }
return cssClasses
}
@@ -298,6 +314,26 @@ export default class SInput extends Vue {
border-color: $color-neutral-border;
}
}
+ &.autofill {
+ .placeholder {
+ background-color: transparent !important;
+ }
+ }
+ .el-input > input {
+ &:-webkit-autofill {
+ color: $color-basic-black !important;
+ animation-name: onAutoFillStart; // Expose a hook for JavaScript when auto fill is shown
+ }
+ &:not(:-webkit-autofill) {
+ animation-name: onAutoFillCancel; // Expose a hook for JS onAutoFillCancel
+ }
+ &:-internal-autofill-selected {
+ animation-name: onAutoFillStart;
+ }
+ &:not(:-internal-autofill-selected) {
+ animation-name: onAutoFillCancel;
+ }
+ }
.placeholder + .el-input {
> input {
padding-top: 12px;
@@ -313,10 +349,12 @@ export default class SInput extends Vue {
.el-input > input {
padding-right: 56px;
}
- .s-icon-file {
+ .s-icon-file-upload {
top: 16px;
right: 16px;
+ font-size: 24px;
z-index: 1;
+ position: absolute;
+ input {
cursor: pointer;
position: absolute;
@@ -330,5 +368,12 @@ export default class SInput extends Vue {
}
}
}
-
+@keyframes onAutoFillStart {
+ from {/**/}
+ to {/**/}
+}
+@keyframes onAutoFillCancel {
+ from {/**/}
+ to {/**/}
+}
diff --git a/src/components/Layout/Container/consts.ts b/src/components/Layout/Container/consts.ts
index 1865dc9b..fc6aae38 100644
--- a/src/components/Layout/Container/consts.ts
+++ b/src/components/Layout/Container/consts.ts
@@ -1,4 +1,3 @@
-export enum ContainerDirection {
- VERTICAL = 'vertical',
- HORIZONTAL = 'horizontal'
-}
+import { Direction } from '../../../types'
+
+export const ContainerDirection = Direction
diff --git a/src/components/Layout/Header/SHeader.vue b/src/components/Layout/Header/SHeader.vue
index 2715d822..8fb34577 100644
--- a/src/components/Layout/Header/SHeader.vue
+++ b/src/components/Layout/Header/SHeader.vue
@@ -24,5 +24,6 @@ export default class SHeader extends Vue {
padding: 12px;
box-shadow: 0px 0px 8px rgba(45, 41, 38, 0.2);
font-size: 18px;
+ z-index: 1;
}
diff --git a/src/components/Menu/SMenu.vue b/src/components/Menu/SMenu.vue
index 802a8e64..fa76ffaf 100644
--- a/src/components/Menu/SMenu.vue
+++ b/src/components/Menu/SMenu.vue
@@ -2,6 +2,7 @@