Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5cce4e5
Add divider component
stefashkaa Aug 11, 2020
b116354
Add story for divider component
stefashkaa Aug 11, 2020
55ac707
Fix breaking rule for words in dialog component
stefashkaa Aug 14, 2020
a17826f
Add divider prop for scroll section component
stefashkaa Aug 14, 2020
e5ad2ef
Fix issues
stefashkaa Aug 14, 2020
0b819f6
Add borders prop for Collapse component
stefashkaa Aug 14, 2020
a2d3abf
Fix border color for collapse component
stefashkaa Aug 14, 2020
3476673
Add without padding property for Collapse component
stefashkaa Aug 17, 2020
beca018
Rename withBorders -> borders
stefashkaa Aug 18, 2020
6f247b1
Add font-icons
stefashkaa Aug 17, 2020
8a54336
Modify icons usage for Menu components
stefashkaa Aug 17, 2020
39b82cb
Modify icons usage for Button component
stefashkaa Aug 17, 2020
0f1fe00
Modify icons usage for Form Item component
stefashkaa Aug 17, 2020
12e7d9f
Modify icons usage for Collapse Item component
stefashkaa Aug 17, 2020
4998fd5
Update icon usage for Input component
stefashkaa Aug 17, 2020
52def17
Update icon usage for Dropdown component
stefashkaa Aug 17, 2020
dfe2474
Fix font icon
stefashkaa Aug 18, 2020
8e76d24
Add icons enum
stefashkaa Aug 18, 2020
8ce919f
Add icons check for Button component
stefashkaa Aug 18, 2020
0eea2a2
Add story with a list of icons
stefashkaa Aug 18, 2020
23cc7f8
Remove svg icon files
stefashkaa Aug 18, 2020
b4d3843
Merge pull request #44 from soramitsu/feature/divider
stefashkaa Aug 18, 2020
25f3e0c
Add icon component
stefashkaa Aug 21, 2020
49ac6d9
Fix dropdown styles
stefashkaa Aug 21, 2020
98d8a74
Merge pull request #45 from soramitsu/feature/font-icons
stefashkaa Aug 21, 2020
5fd906b
Add loading directive and service
stefashkaa Aug 23, 2020
f6094d4
Fix browser autofill
stefashkaa Aug 23, 2020
35b31ef
Add tabs components
stefashkaa Aug 24, 2020
40c0a94
Add story for tabs component
stefashkaa Aug 24, 2020
4f06fa0
Update version
stefashkaa Aug 24, 2020
11a839d
Merge pull request #46 from soramitsu/feature/tabs
stefashkaa Aug 25, 2020
23f6422
Merge branch 'develop' into release/0.2.8
stefashkaa Aug 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
Binary file added src/assets/fonts/soramitsu-icons.woff
Binary file not shown.
5 changes: 0 additions & 5 deletions src/assets/icons/activity.svg

This file was deleted.

4 changes: 0 additions & 4 deletions src/assets/icons/arrow-left.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/arrow-top.svg

This file was deleted.

5 changes: 0 additions & 5 deletions src/assets/icons/create.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/email.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/file-upload.svg

This file was deleted.

5 changes: 0 additions & 5 deletions src/assets/icons/globe.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/link-off.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/link-on.svg

This file was deleted.

7 changes: 0 additions & 7 deletions src/assets/icons/log-out.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/more-horizontal.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/play.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/plus.svg

This file was deleted.

12 changes: 0 additions & 12 deletions src/assets/icons/refresh-red.svg

This file was deleted.

12 changes: 0 additions & 12 deletions src/assets/icons/refresh.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icons/stop.svg

This file was deleted.

5 changes: 0 additions & 5 deletions src/assets/icons/warning.svg

This file was deleted.

43 changes: 36 additions & 7 deletions src/components/Button/SButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:icon="elementIcon"
@click="handleClick"
>
<i v-if="availableIcon" :class="[availableIcon]"></i>
<s-icon v-if="availableIcon" :name="availableIcon" />
<slot></slot>
</el-button>
</s-tooltip>
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
}
}
</style>
2 changes: 1 addition & 1 deletion src/components/Button/consts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Size } from '../../types/size'
import { Size } from '../../types'

export enum ButtonTypes {
PRIMARY = 'primary',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkbox/consts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Size } from '../../types/size'
import { Size } from '../../types'

export const CheckboxSize = Size
23 changes: 20 additions & 3 deletions src/components/Collapse/SCollapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<el-collapse
:value="value"
:accordion="accordion"
:style="computedStyles"
@change="handleChange"
>
<slot></slot>
</el-collapse>
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import { Vue, Component, Prop, Provide } from 'vue-property-decorator'

@Component
export default class SCollapse extends Vue {
Expand All @@ -23,6 +24,22 @@ export default class SCollapse extends Vue {
* `false` by default
*/
@Prop({ default: false, type: Boolean }) readonly accordion!: boolean
/**
* Will borders be shown.
*
* `false` by default
*/
@Prop({ default: false, type: Boolean }) readonly borders!: boolean

@Provide('sCollapse') sCollapse = this

get computedStyles (): object {
const styles = {} as any
if (!this.borders) {
styles.border = 'none'
}
return styles
}

handleChange (activeNames: string | number | Array<string | number>): void {
this.$emit('change', activeNames)
Expand All @@ -34,7 +51,7 @@ export default class SCollapse extends Vue {
@import "../../styles/variables.scss";

.el-collapse {
border-top-color: $color-neutral-hover;
border-bottom-color: $color-neutral-hover;
border-top-color: #F5F5F5;
border-bottom-color: #F5F5F5;
}
</style>
54 changes: 38 additions & 16 deletions src/components/Collapse/SCollapseItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
:title="title"
:name="name"
:disabled="disabled"
:class="computedClasses"
>
<slot slot="title" name="title"></slot>
<slot></slot>
</el-collapse-item>
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
import { Vue, Component, Prop, Inject } from 'vue-property-decorator'

@Component
export default class SCollapseItem extends Vue {
Expand All @@ -28,41 +29,62 @@ export default class SCollapseItem extends Vue {
* `false` by default
*/
@Prop({ default: false, type: Boolean }) readonly disabled!: boolean
/**
* Will bottom padding be hidden.
*
* `false` by default
*/
@Prop({ default: false, type: Boolean }) readonly withoutPadding!: boolean

@Inject({ default: '', from: 'sCollapse' }) sCollapse

get computedClasses (): Array<string> {
const cssClasses: Array<string> = []
if (!(this.sCollapse || {}).borders) {
cssClasses.push('without-border')
}
if (this.withoutPadding) {
cssClasses.push('without-padding')
}
return cssClasses
}
}
</script>

<style lang="scss">
@import "../../styles/variables.scss";
// @import "../../styles/icons.scss";
@import "../../styles/icons.scss";

.without-border {
> div > .el-collapse-item__header,
> .el-collapse-item__wrap {
border: none;
}
}
.without-padding > .el-collapse-item__wrap > .el-collapse-item__content {
padding-bottom: 0;
}
.el-collapse-item__ {
&wrap {
border-bottom-color: $color-neutral-hover;
border-bottom-color: #F5F5F5;
}
&header {
color: $color-basic-black;
border-bottom-color: $color-neutral-hover;
border-bottom-color: #F5F5F5;
&.is-active {
border-bottom-color: transparent;
}
// TODO: fix it. @extend doesn't work in the current implementation
.el-icon-arrow-right {
// @extend .s-icon-arrow-top;
padding: 10px;
// padding: 8px;
font-family: 'soramitsu-icons' !important;
@extend .s-icon-chevron-top;
font-size: 16px;
padding: 8px;
width: 32px;
height: 32px;
background-color: $color-neutral-placeholder;
border-radius: 50%;
&::before {
// content: '';
color: $color-basic-black; // TODO: remove these lines
font-weight: bold;
}
transform: rotate(90deg); // TODO: remove it
&.is-active {
// transform: rotate(180deg);
transform: rotate(270deg);
transform: rotate(180deg);
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Dialog/SDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,8 @@ export default class SDialog extends Vue {
font-size: 16px;
color: $color-basic-black;
}
> * {
word-break: break-word;
}
}
</style>
Loading