From 42ef6e776aa8787bc4948178e515f81a82fa1aff Mon Sep 17 00:00:00 2001 From: Alex Natalia <38787212+alexnatalia@users.noreply.github.com> Date: Wed, 11 Nov 2020 19:34:13 +0300 Subject: [PATCH 1/6] Customization bug fix (#88) * Fixed colors customization bug. * Updated to 0.5.7 version. --- package.json | 2 +- src/stories/Intro/Customization.stories.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 70a1dd7f..edce40d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "0.5.6", + "version": "0.5.7", "private": false, "publishConfig": { "registry": "https://nexus.iroha.tech/repository/npm-soramitsu-private/" diff --git a/src/stories/Intro/Customization.stories.ts b/src/stories/Intro/Customization.stories.ts index 43df1693..17083f81 100644 --- a/src/stories/Intro/Customization.stories.ts +++ b/src/stories/Intro/Customization.stories.ts @@ -10,10 +10,11 @@ export default { excludeStories: /.*Data$/ } -const getColorsData = (colors) => Object.values(colors).map(color => { - const value = getComputedStyle(document.documentElement).getPropertyValue(`--s-color-${color}`) +const colorPropertyPrefix = '--s-color-' +const getColorsData = (colors) => Object.values(colors).map(colorPropertyName => { + const value = getComputedStyle(document.documentElement).getPropertyValue(`${colorPropertyPrefix}${colorPropertyName}`) const isRgb = value.includes('rgb') - return { label: color, value, isRgb } + return { label: colorPropertyName, value, isRgb } }) export const colorsSectionsData = [ { title: 'Theme / Accent', colors: getColorsData(AccentColors) }, @@ -84,7 +85,7 @@ export const configurable = () => ({ }), methods: { handleColorChange: (label: string, color: string) => { - document.documentElement.style.setProperty(label, color) + document.documentElement.style.setProperty(`${colorPropertyPrefix}${label}`, color) } } }) From 8ef86b4b90a55749793859824dc7b148f09a1914 Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Tue, 17 Nov 2020 11:58:26 +0300 Subject: [PATCH 2/6] Fix imports (#90) * Fix issues with import * Add version control for icons font * Add shadow css variables --- package.json | 2 +- ...amitsu-icons.woff => soramitsu-icons-1.0.0.woff} | Bin src/styles/breadcrumbs.scss | 2 -- src/styles/button.scss | 2 -- src/styles/card.scss | 2 -- src/styles/checkbox.scss | 3 --- src/styles/collapse.scss | 2 -- src/styles/common.scss | 2 -- src/styles/datepicker.scss | 2 -- src/styles/dialog.scss | 2 -- src/styles/dropdown.scss | 2 -- src/styles/element-variables.scss | 2 -- src/styles/fonts.scss | 2 +- src/styles/form.scss | 2 -- src/styles/icons.scss | 2 -- src/styles/input.scss | 2 -- src/styles/json-input.scss | 3 --- src/styles/layout.scss | 2 -- src/styles/pagination.scss | 2 -- src/styles/radio.scss | 3 --- src/styles/scroll-sections.scss | 2 -- src/styles/select.scss | 3 --- src/styles/slider.scss | 2 -- src/styles/switch.scss | 2 -- src/styles/table.scss | 2 -- src/styles/tabs.scss | 2 -- src/styles/tooltip.scss | 2 -- src/styles/variables.scss | 10 +++++++++- 28 files changed, 11 insertions(+), 55 deletions(-) rename src/assets/fonts/{soramitsu-icons.woff => soramitsu-icons-1.0.0.woff} (100%) diff --git a/package.json b/package.json index edce40d6..b4faac03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "0.5.7", + "version": "0.5.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-1.0.0.woff similarity index 100% rename from src/assets/fonts/soramitsu-icons.woff rename to src/assets/fonts/soramitsu-icons-1.0.0.woff diff --git a/src/styles/breadcrumbs.scss b/src/styles/breadcrumbs.scss index 3e62ec6f..1d819577 100644 --- a/src/styles/breadcrumbs.scss +++ b/src/styles/breadcrumbs.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-breadcrumb__separator { color: var(--s-color-base-content-tertiary); font-weight: normal; diff --git a/src/styles/button.scss b/src/styles/button.scss index adf7d741..13fe0985 100644 --- a/src/styles/button.scss +++ b/src/styles/button.scss @@ -1,5 +1,3 @@ -@import "./variables"; - $s-color-button-tertiary-color: var(--s-color-base-content-primary) !default; $s-color-button-tertiary-color-active: var(--s-color-theme-accent) !default; $s-color-button-tertiary-background: var(--s-color-base-background) !default; diff --git a/src/styles/card.scss b/src/styles/card.scss index 9619569f..edc23ef7 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .s-card { color: var(--s-color-base-content-primary); border-radius: 8px; diff --git a/src/styles/checkbox.scss b/src/styles/checkbox.scss index bb9e8af2..e8dce297 100644 --- a/src/styles/checkbox.scss +++ b/src/styles/checkbox.scss @@ -1,6 +1,3 @@ -@import "./variables"; -@import "./common"; - .el-checkbox { color: var(--s-color-base-content-primary); &.is-bordered { diff --git a/src/styles/collapse.scss b/src/styles/collapse.scss index 8a24398c..3a907164 100644 --- a/src/styles/collapse.scss +++ b/src/styles/collapse.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-collapse { border-top-color: var(--s-color-base-border-secondary); border-bottom-color: var(--s-color-base-border-secondary); diff --git a/src/styles/common.scss b/src/styles/common.scss index 5909f007..508f9b87 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -1,5 +1,3 @@ -@import "./variables"; - [class^="el-"]:not(i):not([class*='el-icon']), [class*="el-"]:not(i):not([class*='el-icon']) { font-family: $s-font-family-default; diff --git a/src/styles/datepicker.scss b/src/styles/datepicker.scss index 76705c12..e2054d22 100644 --- a/src/styles/datepicker.scss +++ b/src/styles/datepicker.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .s-date-picker { font-family: $s-font-family-default; width: 100%; diff --git a/src/styles/dialog.scss b/src/styles/dialog.scss index d469b2ed..840b6191 100644 --- a/src/styles/dialog.scss +++ b/src/styles/dialog.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-dialog { border-radius: 8px; .el-dialog__title { diff --git a/src/styles/dropdown.scss b/src/styles/dropdown.scss index ac7eb2e4..9801d26a 100644 --- a/src/styles/dropdown.scss +++ b/src/styles/dropdown.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-dropdown { color: var(--s-color-base-content-primary); > .el-button-group { diff --git a/src/styles/element-variables.scss b/src/styles/element-variables.scss index 61642300..ae861389 100644 --- a/src/styles/element-variables.scss +++ b/src/styles/element-variables.scss @@ -1,5 +1,3 @@ -@import "./variables"; - $--color-primary: $s-color-theme-accent; $--color-danger: $s-color-status-error; $--color-success: $s-color-status-success; diff --git a/src/styles/fonts.scss b/src/styles/fonts.scss index ed2a1131..e5ebf686 100644 --- a/src/styles/fonts.scss +++ b/src/styles/fonts.scss @@ -1,6 +1,6 @@ @font-face { font-family: "soramitsu-icons"; - src: url("~@/assets/fonts/soramitsu-icons.woff"); + src: url("~@/assets/fonts/soramitsu-icons-1.0.0.woff"); font-weight: normal; font-style: normal; font-display: block; diff --git a/src/styles/form.scss b/src/styles/form.scss index eeea8fe7..473f6c56 100644 --- a/src/styles/form.scss +++ b/src/styles/form.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-form-item { margin-bottom: 12px; &__content { diff --git a/src/styles/icons.scss b/src/styles/icons.scss index 2aea6089..ee98cbc5 100644 --- a/src/styles/icons.scss +++ b/src/styles/icons.scss @@ -1,5 +1,3 @@ -@import "./variables"; - [class^="s-icon-"], [class*=" s-icon-"] { font-family: 'soramitsu-icons' !important; font-style: normal; diff --git a/src/styles/input.scss b/src/styles/input.scss index 2e748fa6..b4c81805 100644 --- a/src/styles/input.scss +++ b/src/styles/input.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .s-input { font-family: $s-font-family-default; width: 100%; diff --git a/src/styles/json-input.scss b/src/styles/json-input.scss index 2229f1c9..f633a69e 100644 --- a/src/styles/json-input.scss +++ b/src/styles/json-input.scss @@ -1,6 +1,3 @@ -@import "./variables"; -// @import "./icons"; - $color-ide-variable: #0451A5; $color-ide-string: #A31515; $color-ide-number: #098658; diff --git a/src/styles/layout.scss b/src/styles/layout.scss index c16b9c73..7eabcde8 100644 --- a/src/styles/layout.scss +++ b/src/styles/layout.scss @@ -1,5 +1,3 @@ -@import "./common"; - $box-shadow-layout: 0px 0px 8px rgba(45, 41, 38, 0.2); $font-size-layout: 18px; diff --git a/src/styles/pagination.scss b/src/styles/pagination.scss index 5f7805c1..32cb4d05 100644 --- a/src/styles/pagination.scss +++ b/src/styles/pagination.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-pagination { &.is-background .el-pager li:not(.disabled) { &.active { diff --git a/src/styles/radio.scss b/src/styles/radio.scss index 1763dc82..2135b5b7 100644 --- a/src/styles/radio.scss +++ b/src/styles/radio.scss @@ -1,6 +1,3 @@ -@import "./variables"; -@import "./common"; - $radio-button-class: ".el-radio-button"; $radio-button-border-width: 1px; $radio-button-border-color: var(--s-color-theme-accent); diff --git a/src/styles/scroll-sections.scss b/src/styles/scroll-sections.scss index 8cb89fdf..cfa4a1a1 100644 --- a/src/styles/scroll-sections.scss +++ b/src/styles/scroll-sections.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .s-scroll-sections { font-family: $s-font-family-default; font-size: 14px; diff --git a/src/styles/select.scss b/src/styles/select.scss index 7af02217..83b65ab7 100644 --- a/src/styles/select.scss +++ b/src/styles/select.scss @@ -1,6 +1,3 @@ -@import "./variables"; -@import "./icons"; - .s-select { font-family: $s-font-family-default; width: 100%; diff --git a/src/styles/slider.scss b/src/styles/slider.scss index 1c02c827..477ede57 100644 --- a/src/styles/slider.scss +++ b/src/styles/slider.scss @@ -1,5 +1,3 @@ -@import "./variables"; - @mixin slider-colors( $background-color: --s-color-theme-accent, $border-color: $background-color, diff --git a/src/styles/switch.scss b/src/styles/switch.scss index 86ec5ac0..b176320d 100644 --- a/src/styles/switch.scss +++ b/src/styles/switch.scss @@ -1,5 +1,3 @@ -@import "./variables"; - $switch-class: ".el-switch"; .s-switch { diff --git a/src/styles/table.scss b/src/styles/table.scss index f4a3319c..fadd0078 100644 --- a/src/styles/table.scss +++ b/src/styles/table.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-table, .el-table__header-wrapper tbody td, .el-table__footer-wrapper tbody td { diff --git a/src/styles/tabs.scss b/src/styles/tabs.scss index 7df25f8f..b86e52b6 100644 --- a/src/styles/tabs.scss +++ b/src/styles/tabs.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .s-tabs { width: 100%; .el-tabs__item { diff --git a/src/styles/tooltip.scss b/src/styles/tooltip.scss index 5bb1cc99..2e28040c 100644 --- a/src/styles/tooltip.scss +++ b/src/styles/tooltip.scss @@ -1,5 +1,3 @@ -@import "./variables"; - .el-tooltip__popper { &.is-dark { background-color: var(--s-color-base-content-primary); diff --git a/src/styles/variables.scss b/src/styles/variables.scss index f9b61c17..b23829bd 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -10,7 +10,7 @@ $s-color-theme-secondary-pressed: #F1C0D2 !default; $s-color-theme-secondary-focused: #EDABC3 !default; // Base content colors $s-color-base-content-primary: #2D2926 !default; -$s-color-base-content-secondary: #53565A !default; // not used +$s-color-base-content-secondary: #53565A !default; $s-color-base-content-tertiary: #75787B !default; $s-color-base-content-quaternary: #A3A4A8 !default; // Base misc colors @@ -86,6 +86,7 @@ $--breakpoints-spec: ( ); :root { + // Colors --s-color-theme-accent: #{$s-color-theme-accent}; --s-color-theme-accent-hover: #{$s-color-theme-accent-hover}; --s-color-theme-accent-pressed: #{$s-color-theme-accent-pressed}; @@ -115,4 +116,11 @@ $--breakpoints-spec: ( --s-color-status-success-background: #{$s-color-status-success-background}; --s-color-status-warning-background: #{$s-color-status-warning-background}; --s-color-status-error-background: #{$s-color-status-error-background}; + // Shadows + --s-shadow-surface: #{$s-shadow-surface}; + --s-shadow-tooltip: #{$s-shadow-tooltip}; + --s-shadow-tab: #{$s-shadow-tab}; + --s-shadow-dropdown: #{$s-shadow-dropdown}; + --s-shadow-mobile-tap-bar: #{$s-shadow-mobile-tap-bar}; + --s-shadow-mobile-side-menu: #{$s-shadow-mobile-side-menu}; } From a78c2a8ec53faaf31e6e753414d30bc663f2a310 Mon Sep 17 00:00:00 2001 From: Alex Natalia <38787212+alexnatalia@users.noreply.github.com> Date: Wed, 18 Nov 2020 14:11:11 +0300 Subject: [PATCH 3/6] Border Radius Configuration (#85) * Added Border Radius configuration. * Updated Tabs, Table, Button, Card, Dialog, Checkbox, Pagination, Input, Select, Date Picker, Tooltip, Dropdown, Form, Radio, Menu components and stories. * Added Size and Border Radius mixins, embedded mixins to components. --- package.json | 2 +- src/components/Button/SButton.vue | 27 +++----- src/components/Button/consts.ts | 4 -- src/components/Button/index.ts | 4 +- src/components/Card/SCard.vue | 18 ++++- src/components/Checkbox/SCheckbox.vue | 26 +++---- src/components/Checkbox/consts.ts | 3 - src/components/Checkbox/index.ts | 3 +- src/components/DatePicker/SDatePicker.vue | 35 ++++++---- src/components/DatePicker/consts.ts | 4 -- src/components/DatePicker/index.ts | 5 +- src/components/Dialog/SDialog.vue | 19 ++++- src/components/Dropdown/SDropdown.vue | 45 +++++++----- src/components/Dropdown/consts.ts | 4 -- src/components/Dropdown/index.ts | 3 +- src/components/Form/SForm.vue | 1 + src/components/Form/SFormItem.vue | 3 +- src/components/Input/SInput.vue | 10 ++- src/components/Menu/SMenu.vue | 15 +++- src/components/Pagination/SPagination.vue | 28 +++++++- src/components/Radio/SRadio.vue | 14 ++-- src/components/Radio/SRadioGroup.vue | 14 ++-- src/components/Radio/consts.ts | 3 - src/components/Radio/index.ts | 3 +- src/components/Select/SSelect.vue | 24 ++++++- src/components/Tab/STabs.vue | 8 ++- src/components/Table/STable.vue | 15 ++-- src/components/Table/consts.ts | 2 - src/components/Table/index.ts | 5 +- src/components/Tooltip/STooltip.vue | 21 +++++- src/mixins/BorderRadiusMixin.ts | 16 +++++ src/mixins/SizeMixin.ts | 23 ++++++ src/stories/Dropdown/SDropdown.stories.ts | 14 +++- src/stories/Intro/Customization.stories.ts | 27 +++++++- src/stories/Menu/SMenu.stories.ts | 20 ++++++ src/stories/SButton.stories.ts | 31 ++++++++- src/stories/SCard.stories.ts | 8 ++- src/stories/SCheckbox.stories.ts | 33 ++++++++- src/stories/SDatePicker.stories.ts | 8 ++- src/stories/SDialog.stories.ts | 7 +- src/stories/SInput.stories.ts | 5 ++ src/stories/SPagination.stories.ts | 8 ++- src/stories/SRadio.stories.ts | 6 +- src/stories/STooltip.stories.ts | 5 ++ src/stories/Select/SSelect.stories.ts | 8 ++- src/stories/Tab/STabs.stories.ts | 5 ++ src/stories/Table/STable.stories.ts | 4 +- src/styles/button.scss | 1 - src/styles/card.scss | 1 - src/styles/checkbox.scss | 33 +++++++-- src/styles/common.scss | 18 ++++- src/styles/datepicker.scss | 81 ++++++++++++++++------ src/styles/dialog.scss | 23 +++++- src/styles/dropdown.scss | 18 +++++ src/styles/input.scss | 26 ++++++- src/styles/json-input.scss | 4 +- src/styles/menu.scss | 25 +++++-- src/styles/pagination.scss | 51 +++++++++++--- src/styles/select.scss | 30 ++++++-- src/styles/table.scss | 2 +- src/styles/tabs.scss | 50 ++++++++++--- src/styles/variables.scss | 17 ++++- src/types/index.ts | 7 ++ 63 files changed, 747 insertions(+), 236 deletions(-) delete mode 100644 src/components/Checkbox/consts.ts delete mode 100644 src/components/Radio/consts.ts create mode 100644 src/mixins/BorderRadiusMixin.ts create mode 100644 src/mixins/SizeMixin.ts diff --git a/package.json b/package.json index b4faac03..38c7556d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@soramitsu/soramitsu-js-ui", - "version": "0.5.8", + "version": "0.6.0", "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 14cb1635..e2cecedc 100644 --- a/src/components/Button/SButton.vue +++ b/src/components/Button/SButton.vue @@ -20,19 +20,21 @@