chore: Refactor sidebar related changes for RTL (#6519)

* Woot tabs

* Refactor sidebar related RTL

* Context menu

* chore: Minor fixes

* chore: Dropdown

* chore: Toggle switch

* chore: sidebar fixes

* fix: spacing issues and minor fixes

* chore: Space slab to small

---------

Co-authored-by: Nithin David <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
Sivin Varghese
2023-02-24 13:01:54 +05:30
committed by GitHub
parent 6d4b894f95
commit 9fcb29484d
20 changed files with 110 additions and 73 deletions

View File

@@ -13,6 +13,10 @@
padding: var(--space-smaller) var(--space-one) var(--space-smaller) padding: var(--space-smaller) var(--space-one) var(--space-smaller)
var(--space-smaller); var(--space-smaller);
} }
.status-items .button {
text-align: right;
}
} }
} }
@@ -23,10 +27,13 @@
border-right: 0; border-right: 0;
.nested.vertical.menu { .nested.vertical.menu {
align-items: flex-start; .badge--icon {
margin-left: var(--space-smaller);
margin-right: unset;
}
li { .menu-label {
direction: initial; text-align: right;
} }
} }
@@ -74,7 +81,7 @@
.settings-header { .settings-header {
.header--icon { .header--icon {
margin-left: 0; margin-left: 0;
margin-right: $space-small; margin-right: var(--space-small);
} }
} }
@@ -95,13 +102,13 @@
// Woot Tabs // Woot Tabs
.tabs-title { .tabs-title {
&:first-child { &:first-child {
margin-left: $space-slab; margin-left: var(--space-small);
margin-right: unset; margin-right: unset;
} }
&:last-child { &:last-child {
margin-left: unset; margin-left: unset;
margin-right: $space-slab; margin-right: var(--space-small);
} }
} }
@@ -133,7 +140,7 @@
.user--profile__meta { .user--profile__meta {
margin-left: unset; margin-left: unset;
margin-right: $space-slab; margin-right: var(--space-small);
} }
} }
@@ -315,7 +322,7 @@
.notification-content--wrap { .notification-content--wrap {
margin-left: 0; margin-left: 0;
margin-right: var(--space-slab); margin-right: var(--space-small);
} }
} }
@@ -326,8 +333,9 @@
} }
} }
.header-left-wrap .page-title { // scss-lint:disable SelectorDepth
margin-right: var(--space-slab) !important; .container .header-wrap .header-left-wrap .header-left-wrap > .page-title {
margin-right: var(--space-small);
} }
.portal-container .container { .portal-container .container {
@@ -408,6 +416,28 @@
justify-content: flex-end; justify-content: flex-end;
} }
// Toggle switch
.toggle-button {
&.small {
span {
&.active {
transform: translate(var(--space-minus-small), var(--space-zero));
}
}
}
span {
--minus-space-one-point-five: -1.5rem;
&.active {
transform: translate(
var(--minus-space-one-point-five),
var(--space-zero)
);
}
}
}
// Widget builder // Widget builder
.widget-builder-container .widget-preview { .widget-builder-container .widget-preview {
direction: initial; direction: initial;
@@ -455,4 +485,9 @@
.contact--form .input-group { .contact--form .input-group {
direction: initial; direction: initial;
} }
// scss-lint:disable QualifyingElement
.dropdown-menu--header > span.title {
text-align: right;
}
} }

View File

@@ -47,7 +47,7 @@ $resolve-button-width: 13.2rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
margin-left: $space-slab; margin-left: var(--space-small);
min-width: 0; min-width: 0;
} }
} }

View File

@@ -1,7 +1,7 @@
.side-menu { .side-menu {
i { i {
margin-right: $space-smaller; margin-right: var(--space-smaller);
min-width: $space-two; min-width: var(--space-two);
} }
} }
@@ -18,14 +18,14 @@
.nested { .nested {
a { a {
font-size: $font-size-small; font-size: var(--font-size-small);
margin-bottom: $space-micro; margin-bottom: var(--space-micro);
margin-top: $space-micro; margin-top: var(--space-micro);
.inbox-icon { .inbox-icon {
display: inline-block; display: inline-block;
margin-right: $space-micro; margin-right: var(--space-micro);
min-width: $space-normal; min-width: var(--space-normal);
text-align: center; text-align: center;
} }
} }
@@ -38,7 +38,8 @@
@include space-between-column; @include space-between-column;
@include border-normal-top; @include border-normal-top;
flex-direction: column; flex-direction: column;
padding: $space-one $space-normal $space-one $space-one; padding: var(--space-one) var(--space-normal) var(--space-one)
var(--space-one);
position: relative; position: relative;
&:hover { &:hover {
@@ -60,14 +61,18 @@
.hamburger--menu { .hamburger--menu {
cursor: pointer; cursor: pointer;
display: block; display: block;
margin-right: $space-normal; margin-right: var(--space-normal);
} }
.header--icon { .header--icon {
display: block; display: block;
margin-right: $space-normal; margin: 0 var(--space-normal);
@media screen and (max-width: 1200px) { @media screen and (max-width: 1200px) {
display: none; display: none;
} }
} }
.header-title {
margin: 0 var(--space-small);
}

View File

@@ -47,7 +47,7 @@
.tabs-title { .tabs-title {
flex-shrink: 0; flex-shrink: 0;
margin: 0 var(--space-slab); margin: 0 var(--space-small);
.badge { .badge {
background: var(--color-background); background: var(--color-background);

View File

@@ -26,6 +26,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
data() { data() {
return { showSwitchButton: false }; return { showSwitchButton: false };
@@ -69,7 +70,7 @@ export default {
} }
.switch-button { .switch-button {
margin-right: var(--space-small); margin: 0 var(--space-small);
} }
.account-context--switch-group { .account-context--switch-group {

View File

@@ -3,7 +3,7 @@
<div <div
v-if="show" v-if="show"
v-on-clickaway="onClickAway" v-on-clickaway="onClickAway"
class="dropdown-pane" class="options-menu dropdown-pane"
:class="{ 'dropdown-pane--open': show }" :class="{ 'dropdown-pane--open': show }"
> >
<availability-status /> <availability-status />
@@ -150,10 +150,10 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dropdown-pane { .options-menu.dropdown-pane {
left: var(--space-slab); left: var(--space-slab);
bottom: var(--space-larger); bottom: var(--space-larger);
min-width: 22rem; min-width: var(--space-giga);
top: unset; top: unset;
z-index: var(--z-index-low); z-index: var(--z-index-low);
} }

View File

@@ -331,11 +331,11 @@ export default {
.beta { .beta {
padding-right: var(--space-smaller) !important; padding-right: var(--space-smaller) !important;
padding-left: var(--space-smaller) !important; padding-left: var(--space-smaller) !important;
margin-left: var(--space-smaller) !important; margin: 0 var(--space-smaller) !important;
display: inline-block; display: inline-block;
font-size: var(--font-size-micro); font-size: var(--font-size-micro);
font-weight: var(--font-weight-medium); font-weight: var(--font-weight-medium);
line-height: 18px; line-height: 14px;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 2em; border-radius: 2em;
color: var(--g-800); color: var(--g-800);
@@ -348,7 +348,7 @@ export default {
color: var(--s-600); color: var(--s-600);
font-size: var(--font-size-micro); font-size: var(--font-size-micro);
font-weight: var(--font-weight-bold); font-weight: var(--font-weight-bold);
margin-left: var(--space-smaller); margin: 0 var(--space-smaller);
padding: var(--space-zero) var(--space-smaller); padding: var(--space-zero) var(--space-smaller);
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<button class="back-button" @click.capture="goBack"> <button class="settings back-button" @click.capture="goBack">
<fluent-icon icon="chevron-left" /> <fluent-icon icon="chevron-left" />
{{ buttonLabel || $t('GENERAL_SETTINGS.BACK') }} {{ buttonLabel || $t('GENERAL_SETTINGS.BACK') }}
</button> </button>
@@ -29,4 +29,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped></style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div <div
class="conversation-details-wrap" class="conversation-details-wrap"
:class="{ 'with-border-left': !isOnExpandedLayout }" :class="{ 'with-border-right': !isOnExpandedLayout }"
> >
<conversation-header <conversation-header
v-if="currentChat.id" v-if="currentChat.id"
@@ -144,8 +144,8 @@ export default {
width: 100%; width: 100%;
background: var(--color-background-light); background: var(--color-background-light);
&.with-border-left { &.with-border-right {
border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border);
} }
} }
@@ -164,6 +164,7 @@ export default {
} }
.conversation-sidebar-wrap { .conversation-sidebar-wrap {
border-right: 1px solid var(--color-border);
height: auto; height: auto;
flex: 0 0; flex: 0 0;
z-index: var(--z-index-low); z-index: var(--z-index-low);

View File

@@ -51,15 +51,11 @@ export default {
border-radius: var(--border-radius-small); border-radius: var(--border-radius-small);
overflow: hidden; overflow: hidden;
.menu-label { .menu-label {
margin: 0; margin: 0 var(--space-small);
font-size: var(--font-size-mini); font-size: var(--font-size-mini);
flex-shrink: 0; flex-shrink: 0;
} }
.menu-icon {
margin-right: var(--space-small);
}
&:hover { &:hover {
background-color: var(--w-500); background-color: var(--w-500);
color: var(--white); color: var(--white);
@@ -68,7 +64,6 @@ export default {
.agent-thumbnail { .agent-thumbnail {
margin-top: 0 !important; margin-top: 0 !important;
margin-right: var(--space-small);
} }
.label-pill { .label-pill {
@@ -77,6 +72,5 @@ export default {
border-radius: var(--border-radius-rounded); border-radius: var(--border-radius-rounded);
border: 1px solid var(--s-50); border: 1px solid var(--s-50);
flex-shrink: 0; flex-shrink: 0;
margin-right: var(--space-small);
} }
</style> </style>

View File

@@ -43,13 +43,9 @@ export default {
align-items: center; align-items: center;
.menu-label { .menu-label {
margin: 0; margin: 0 var(--space-small);
font-size: var(--font-size-mini); font-size: var(--font-size-mini);
} }
.menu-icon {
margin-right: var(--space-small);
}
} }
.submenu { .submenu {

View File

@@ -2,9 +2,11 @@
<div class="header--wrap"> <div class="header--wrap">
<div class="header-left--wrap"> <div class="header-left--wrap">
<woot-sidemenu-icon /> <woot-sidemenu-icon />
<div class="header-title">
<h3 class="page-title">{{ headerTitle }}</h3> <h3 class="page-title">{{ headerTitle }}</h3>
<span class="text-block-title count-view">{{ `(${count})` }}</span> <span class="text-block-title count-view">{{ `(${count})` }}</span>
</div> </div>
</div>
<div class="header-right--wrap"> <div class="header-right--wrap">
<woot-button <woot-button
v-if="shouldShowSettings" v-if="shouldShowSettings"
@@ -160,16 +162,21 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
.header-title {
display: flex;
align-items: center;
margin: 0 var(--space-smaller);
.page-title { .page-title {
margin-bottom: 0; margin-bottom: 0;
} }
}
} }
.header-right--wrap { .header-right--wrap {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.count-view { .count-view {
margin-left: var(--space-smaller); margin: 0 var(--space-smaller);
} }
.dropdown-pane--open { .dropdown-pane--open {
top: var(--space-larger); top: var(--space-larger);

View File

@@ -6,6 +6,7 @@
variant="clear" variant="clear"
size="small" size="small"
color-scheme="primary" color-scheme="primary"
class="back-button"
@click="onClickGoBack" @click="onClickGoBack"
> >
{{ backButtonLabel }} {{ backButtonLabel }}
@@ -42,7 +43,7 @@
v-if="!isSidebarOpen" v-if="!isSidebarOpen"
v-tooltip.top-end="$t('HELP_CENTER.EDIT_HEADER.OPEN_SIDEBAR')" v-tooltip.top-end="$t('HELP_CENTER.EDIT_HEADER.OPEN_SIDEBAR')"
icon="pane-open" icon="pane-open"
class-names="article--buttons" class-names="article--buttons sidebar-button"
variant="hollow" variant="hollow"
size="small" size="small"
color-scheme="secondary" color-scheme="secondary"

View File

@@ -7,6 +7,7 @@
@open-key-shortcut-modal="toggleKeyShortcutModal" @open-key-shortcut-modal="toggleKeyShortcutModal"
@close-key-shortcut-modal="closeKeyShortcutModal" @close-key-shortcut-modal="closeKeyShortcutModal"
/> />
<div class="secondary-sidebar">
<help-center-sidebar <help-center-sidebar
v-if="showHelpCenterSidebar" v-if="showHelpCenterSidebar"
:header-title="headerTitle" :header-title="headerTitle"
@@ -18,6 +19,7 @@
@open-popover="openPortalPopover" @open-popover="openPortalPopover"
@open-modal="onClickOpenAddCategoryModal" @open-modal="onClickOpenAddCategoryModal"
/> />
</div>
<section class="app-content columns"> <section class="app-content columns">
<router-view /> <router-view />
<command-bar /> <command-bar />

View File

@@ -190,7 +190,7 @@ export default {
.locale-content { .locale-content {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: space-between;
width: 100%; width: 100%;
} }
@@ -233,10 +233,6 @@ export default {
line-height: var(--space-normal); line-height: var(--space-normal);
width: 100%; width: 100%;
} }
.meta {
flex-grow: 1;
}
} }
} }
</style> </style>

View File

@@ -122,7 +122,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
.page-title { .page-title {
margin-bottom: 0; margin: 0 var(--space-smaller) 0;
} }
} }
} }

View File

@@ -181,7 +181,7 @@ export default {
.notification-type { .notification-type {
font-size: var(--font-size-micro); font-size: var(--font-size-micro);
padding: var(--space-micro) var(--space-smaller); padding: var(--space-micro) var(--space-smaller);
margin-left: var(--space-small); margin: 0 var(--space-small);
background: var(--s-50); background: var(--s-50);
border-radius: var(--border-radius-normal); border-radius: var(--border-radius-normal);
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="settings--content"> <div class="settings--content">
<div class="widget-builder-conatiner"> <div class="widget-builder-container">
<div class="settings-container"> <div class="settings-container">
<div class="settings-content"> <div class="settings-content">
<form @submit.prevent="updateWidget"> <form @submit.prevent="updateWidget">
@@ -420,7 +420,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~dashboard/assets/scss/woot'; @import '~dashboard/assets/scss/woot';
.widget-builder-conatiner { .widget-builder-container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: var(--space-one); padding: var(--space-one);

View File

@@ -140,7 +140,6 @@ export default {
.selector-wrap { .selector-wrap {
position: relative; position: relative;
width: 100%; width: 100%;
margin-right: var(--space-one);
margin-bottom: var(--space-small); margin-bottom: var(--space-small);
.selector-button { .selector-button {

View File

@@ -17,6 +17,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dropdown-menu--header { .dropdown-menu--header {
display: inline-flex;
list-style: none; list-style: none;
.title { .title {