From b7463a3a1699297ffd177c949f055cd3e193f938 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Fri, 26 May 2023 06:04:17 +0300 Subject: [PATCH] Fixed filters, popups, tags, activity. (#3260) Signed-off-by: Alexander Platov --- packages/theme/styles/_layouts.scss | 2 + packages/theme/styles/button.scss | 47 +++++++++++++++++-- packages/theme/styles/popups.scss | 2 +- packages/ui/src/components/Button.svelte | 45 +----------------- .../ui/src/components/EditWithIcon.svelte | 36 ++++++-------- packages/ui/src/components/ListView.svelte | 1 + packages/ui/src/popups.ts | 4 +- .../src/components/TxView.svelte | 8 ++-- .../src/components/CollapsedTags.svelte | 2 +- .../src/components/TagFilterPresenter.svelte | 2 +- .../components/TagReferencePresenter.svelte | 4 +- .../src/components/TagsPopup.svelte | 2 +- .../components/ComponentPresenter.svelte | 4 +- .../PriorityFilterValuePresenter.svelte | 2 +- .../projects/ProjectPresenter.svelte | 5 +- .../src/components/ValueSelector.svelte | 1 + .../src/components/filter/FilterButton.svelte | 15 ++---- .../components/filter/FilterSection.svelte | 25 ++++++---- .../src/components/icons/Close.svelte | 27 +++++++++++ 19 files changed, 130 insertions(+), 104 deletions(-) create mode 100644 plugins/view-resources/src/components/icons/Close.svelte diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index f94805eff5..70f2e475b4 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -282,6 +282,7 @@ input.search { &:not(.small-gap, .large-gap) { margin-right: .375rem; } &.small-gap { margin-right: .25rem; } &.large-gap { margin-right: .5rem; } + &.flow:last-child { margin-right: 0; } } .label { min-width: 0; @@ -338,6 +339,7 @@ input.search { .icon.circle { transform: translateY(.375rem); } .avatar-container:not(.no-img) { transform: translateY(.375rem); } .avatar-container.no-img { transform: translateY(.15rem); } + .emoji { transform: none; } } .buttons-group { diff --git a/packages/theme/styles/button.scss b/packages/theme/styles/button.scss index c8c37a8757..4c17308f31 100644 --- a/packages/theme/styles/button.scss +++ b/packages/theme/styles/button.scss @@ -11,6 +11,47 @@ transition-property: border, background-color, color, box-shadow; transition-duration: 0.15s; + &.inline { + height: 1.375rem; + font-size: 0.75rem; + line-height: 0.75rem; + &.only-icon { + width: 1.375rem; + } + } + &.x-small { + height: 1.5rem; + font-size: 0.75rem; + &.only-icon { + width: 1.5rem; + } + } + &.small { + height: 1.75rem; + font-size: 0.8125rem; + &.only-icon { + width: 1.75rem; + } + } + &.medium { + height: 2rem; + &.only-icon { + width: 2rem; + } + } + &.large { + height: 2.25rem; + &.only-icon { + width: 2.25rem; + } + } + &.x-large { + height: 2.75rem; + &.only-icon { + width: 2.75rem; + } + } + &.iconL:not(.iconR) { padding: 0 1rem 0 0.75rem; } @@ -89,7 +130,7 @@ color: var(--theme-caption-color); } } - &:focus { + &:not(.no-focus):focus { &:not(.sh-filter) { box-shadow: 0 0 0 2px var(--primary-button-focused-border); } @@ -239,7 +280,7 @@ background-color: var(--theme-button-hovered); border-color: var(--theme-button-border); } - &:focus { + &:not(.no-focus):focus { box-shadow: none; } } @@ -287,7 +328,7 @@ &:hover { background-color: var(--dangerous-bg-hover); } - &:focus { + &:not(.no-focus):focus { box-shadow: var(--dangerous-shadow); } } diff --git a/packages/theme/styles/popups.scss b/packages/theme/styles/popups.scss index 6cbc54a343..299498434e 100644 --- a/packages/theme/styles/popups.scss +++ b/packages/theme/styles/popups.scss @@ -19,7 +19,7 @@ display: flex; flex-direction: column; width: fit-content; - min-width: 10rem; + min-width: 12.5rem; max-width: 17rem; max-height: 22rem; background: var(--theme-popup-color); diff --git a/packages/ui/src/components/Button.svelte b/packages/ui/src/components/Button.svelte index 334cd73113..108ac9668b 100644 --- a/packages/ui/src/components/Button.svelte +++ b/packages/ui/src/components/Button.svelte @@ -51,6 +51,7 @@ export let iconRightSize: IconSize = 'x-small' export let short: boolean = false export let accent: boolean = false + export let noFocus: boolean = false // $: iconSize = size === 'inline' ? 'inline' : 'small' let iconOnly: boolean = false @@ -100,6 +101,7 @@ bind:this={input} class="antiButton {kind} {size} jf-{justify} sh-{shape ?? 'no-shape'} bs-{borderStyle}" class:only-icon={iconOnly} + class:no-focus={noFocus} class:accent class:highlight class:selected @@ -143,46 +145,3 @@ {#if $$slots.content}{/if} {#if $$slots.iconRight}{/if} - - diff --git a/packages/ui/src/components/EditWithIcon.svelte b/packages/ui/src/components/EditWithIcon.svelte index 20568ba1b6..9d29633514 100644 --- a/packages/ui/src/components/EditWithIcon.svelte +++ b/packages/ui/src/components/EditWithIcon.svelte @@ -19,6 +19,7 @@ import plugin from '../plugin' import type { AnySvelteComponent } from '../types' import Icon from './Icon.svelte' + import Button from './Button.svelte' import IconClose from './icons/Close.svelte' export let icon: Asset | AnySvelteComponent | ComponentType @@ -46,25 +47,29 @@
textHTML.focus()}> -
+
{#if value} -
{ - value = '' - dispatch('change', '') - }} - > - +
+
{/if}
diff --git a/packages/ui/src/components/ListView.svelte b/packages/ui/src/components/ListView.svelte index 240e4a290d..2c8162f5cc 100644 --- a/packages/ui/src/components/ListView.svelte +++ b/packages/ui/src/components/ListView.svelte @@ -91,6 +91,7 @@ user-select: none; .list-item { + margin: 0 0.5rem; min-width: 0; border-radius: 0.25rem; } diff --git a/packages/ui/src/popups.ts b/packages/ui/src/popups.ts index cd20a415bc..01d3b2d92d 100644 --- a/packages/ui/src/popups.ts +++ b/packages/ui/src/popups.ts @@ -148,10 +148,10 @@ export function fitPopupPositionedElement ( } else { // Vertical if (rect.bottom + rectPopup.height + 28 <= docHeight) { - newProps.top = `${rect.bottom + 1}px` + newProps.top = `${rect.bottom + 16}px` direction = 'bottom' } else if (rectPopup.height + 28 < rect.top) { - newProps.bottom = `${docHeight - rect.top + 1}px` + newProps.bottom = `${docHeight - rect.top + 16}px` direction = 'top' } else { newProps.top = newProps.bottom = '16px' diff --git a/plugins/activity-resources/src/components/TxView.svelte b/plugins/activity-resources/src/components/TxView.svelte index 85ba953152..3c0233ec69 100644 --- a/plugins/activity-resources/src/components/TxView.svelte +++ b/plugins/activity-resources/src/components/TxView.svelte @@ -399,7 +399,7 @@ flex-grow: 1; margin-right: 1rem; min-width: 0; - color: var(--content-color); + color: var(--theme-dark-color); .msgactivity-content__header { display: flex; @@ -520,13 +520,13 @@ } .show-diff { - color: var(--accent-color); + color: var(--theme-content-color); cursor: pointer; &:hover { - color: var(--caption-color); + color: var(--theme-caption-color); } &:active { - color: var(--accent-color); + color: var(--theme-content-color); } } diff --git a/plugins/tags-resources/src/components/CollapsedTags.svelte b/plugins/tags-resources/src/components/CollapsedTags.svelte index 54740b7228..4959554b15 100644 --- a/plugins/tags-resources/src/components/CollapsedTags.svelte +++ b/plugins/tags-resources/src/components/CollapsedTags.svelte @@ -25,7 +25,7 @@ {@const valueColor = getPlatformColorDef(value.color ?? 0, $themeStore.dark)} {#if i < limit}
-
+
{#if i === limit - 1 && values.length <= limit} {value.title} diff --git a/plugins/tags-resources/src/components/TagFilterPresenter.svelte b/plugins/tags-resources/src/components/TagFilterPresenter.svelte index 8bda54f891..4c370a70ab 100644 --- a/plugins/tags-resources/src/components/TagFilterPresenter.svelte +++ b/plugins/tags-resources/src/components/TagFilterPresenter.svelte @@ -20,7 +20,7 @@
-
+
{value.title} diff --git a/plugins/tags-resources/src/components/TagReferencePresenter.svelte b/plugins/tags-resources/src/components/TagReferencePresenter.svelte index 2457ff2aeb..568581c3a4 100644 --- a/plugins/tags-resources/src/components/TagReferencePresenter.svelte +++ b/plugins/tags-resources/src/components/TagReferencePresenter.svelte @@ -43,7 +43,7 @@ realWidth = element.clientWidth }} > -
+
{value.title} @@ -56,7 +56,7 @@ realWidth = element.clientWidth }} > -
+
{value.title} diff --git a/plugins/tags-resources/src/components/TagsPopup.svelte b/plugins/tags-resources/src/components/TagsPopup.svelte index 982c787a0d..60a13ba15f 100644 --- a/plugins/tags-resources/src/components/TagsPopup.svelte +++ b/plugins/tags-resources/src/components/TagsPopup.svelte @@ -168,7 +168,7 @@ checkSelected(selected, element) }} > -
+
{element.title} ({element.refCount ?? 0}) diff --git a/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte b/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte index 2771c6c3c9..f8e9ba735b 100644 --- a/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte @@ -31,13 +31,13 @@ {#if value} - + {#if !inline && shouldShowAvatar}
{/if} - + {value.label} diff --git a/plugins/tracker-resources/src/components/issues/PriorityFilterValuePresenter.svelte b/plugins/tracker-resources/src/components/issues/PriorityFilterValuePresenter.svelte index 89b924ffa6..e0a5dcdcf8 100644 --- a/plugins/tracker-resources/src/components/issues/PriorityFilterValuePresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/PriorityFilterValuePresenter.svelte @@ -37,7 +37,7 @@
{#each icons as icon} -
+
{/each} diff --git a/plugins/tracker-resources/src/components/projects/ProjectPresenter.svelte b/plugins/tracker-resources/src/components/projects/ProjectPresenter.svelte index 258032edec..2b9ac6503e 100644 --- a/plugins/tracker-resources/src/components/projects/ProjectPresenter.svelte +++ b/plugins/tracker-resources/src/components/projects/ProjectPresenter.svelte @@ -18,10 +18,11 @@ import tracker from '../../plugin' export let value: Project + export let inline = false -
-
+
+
diff --git a/plugins/view-resources/src/components/filter/FilterButton.svelte b/plugins/view-resources/src/components/filter/FilterButton.svelte index 959abe1598..136d630369 100644 --- a/plugins/view-resources/src/components/filter/FilterButton.svelte +++ b/plugins/view-resources/src/components/filter/FilterButton.svelte @@ -15,19 +15,12 @@ + + + +