feat: Update the design for dropdown buttons (#5625)

This commit is contained in:
Nithin David Thomas 2022-10-14 02:06:42 +05:30 committed by GitHub
parent bf4338ef9e
commit 1f271356ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 27 deletions

View file

@ -113,9 +113,22 @@ $default-button-height: 4.0rem;
} }
&.clear { &.clear {
color: var(--w-700);
&.secondary {
color: var(--s-700)
}
&.success {
color: var(--g-700)
}
&.alert {
color: var(--r-700)
}
&.warning { &.warning {
color: var(--y-600); color: var(--y-700)
} }
&:hover { &:hover {
@ -146,6 +159,8 @@ $default-button-height: 4.0rem;
&.small { &.small {
height: var(--space-large); height: var(--space-large);
padding-bottom: var(--space-smaller);
padding-top: var(--space-smaller);
} }
&.large { &.large {

View file

@ -14,15 +14,9 @@
} }
.modal--close { .modal--close {
border-radius: 50%;
color: $color-heading;
cursor: pointer;
font-size: $font-size-big;
line-height: $space-normal;
padding: $space-normal;
position: absolute; position: absolute;
right: $space-micro; right: $space-small;
top: $space-micro; top: $space-small;
&:hover { &:hover {
background: $color-background; background: $color-background;

View file

@ -7,9 +7,13 @@
@click="onBackDropClick" @click="onBackDropClick"
> >
<div :class="modalContainerClassName" @click.stop> <div :class="modalContainerClassName" @click.stop>
<button class="modal--close" @click="close"> <woot-button
<fluent-icon icon="dismiss" /> color-scheme="secondary"
</button> icon="dismiss"
variant="clear"
class="modal--close"
@click="close"
/>
<slot /> <slot />
</div> </div>
</div> </div>

View file

@ -41,9 +41,18 @@
:class="{ 'dropdown-pane--open': showSearchDropdown }" :class="{ 'dropdown-pane--open': showSearchDropdown }"
class="dropdown-pane" class="dropdown-pane"
> >
<h4 class="text-block-title text-truncate"> <div class="dropdown__header">
{{ multiselectorTitle }} <h4 class="text-block-title text-truncate">
</h4> {{ multiselectorTitle }}
</h4>
<woot-button
icon="dismiss"
size="tiny"
color-scheme="secondary"
variant="clear"
@click="onCloseDropdown"
/>
</div>
<multiselect-dropdown-items <multiselect-dropdown-items
v-if="showSearchDropdown" v-if="showSearchDropdown"
:options="options" :options="options"
@ -172,4 +181,15 @@ export default {
width: 100%; width: 100%;
} }
} }
.dropdown__header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-smaller);
.text-block-title {
margin: 0;
}
}
</style> </style>

View file

@ -20,6 +20,7 @@
<woot-button <woot-button
class="multiselect-dropdown--item" class="multiselect-dropdown--item"
variant="clear" variant="clear"
color-scheme="secondary"
:class="{ :class="{
active: option.id === (selectedItem && selectedItem.id), active: option.id === (selectedItem && selectedItem.id),
}" }"
@ -129,7 +130,7 @@ export default {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
max-height: 16rem; max-height: 20rem;
} }
.search-wrap { .search-wrap {
@ -162,7 +163,7 @@ export default {
.multiselect-dropdown--list { .multiselect-dropdown--list {
width: 100%; width: 100%;
max-height: 12rem; max-height: 16rem;
} }
.multiselect-dropdown--item { .multiselect-dropdown--item {
@ -170,13 +171,13 @@ export default {
width: 100%; width: 100%;
&.active { &.active {
background-color: var(--w-50); background-color: var(--w-25);
color: var(--w-900); color: var(--w-800);
font-weight: var(--font-weight-bold); font-weight: var(--font-weight-medium);
} }
&:focus { &:focus {
background-color: var(--color-background); background-color: var(--color-background-light);
} }
} }

View file

@ -29,19 +29,15 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.dropdown-menu__item { .dropdown-menu__item {
list-style: none; list-style: none;
margin-bottom: var(--space-micro);
::v-deep { ::v-deep {
a, a,
.button { .button {
display: inline-flex;
width: 100%; width: 100%;
text-align: left; text-align: left;
color: var(--s-700); color: var(--s-700);
white-space: nowrap;
display: inline-flex;
padding: var(--space-small);
padding-top: var(--space-small);
padding-bottom: var(--space-small);
border-radius: var(--border-radius-normal);
&:hover { &:hover {
background: var(--color-background); background: var(--color-background);