diff --git a/packages/theme/styles/_colors.scss b/packages/theme/styles/_colors.scss index d300e354f9..e048a1990c 100644 --- a/packages/theme/styles/_colors.scss +++ b/packages/theme/styles/_colors.scss @@ -290,7 +290,7 @@ --theme-popup-hover: #F5F5F5; --theme-popup-divider: rgba(0, 0, 0, .1); --theme-popup-header: #EBEBEB; - --theme-popup-shadow: 0px 1px 4px 2px rgba(0, 0, 0, 0.15); + --theme-popup-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2); --theme-panel-color: #FFFFFF; --theme-calendar-today-color: #000; --theme-calendar-holiday-color: #eb5757; diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index e778e9a376..eb654e7ada 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -210,6 +210,8 @@ input.search { .flex-row-top { display: flex; align-items: flex-start; + flex-wrap: nowrap; + min-width: 0; } .flex-row-reverse { display: flex; @@ -394,8 +396,8 @@ input.search { } } .gap-1-5 { - & > * { margin-right: .375rem; } - &.reverse > :last-child { margin-right: .375rem; } + &:not(.reverse) > *:not(:last-child) { margin-right: .375rem; } + &.reverse > *:not(:first-child) { margin-left: .375rem; } } .gap-2 { &:not(.reverse) > *:not(:first-child) { margin-left: .5rem; } @@ -688,7 +690,7 @@ input.search { width: inherit; height: inherit; } -.svg-x-small, .svg-small, .svg-medium, .svg-large { flex-shrink: 0; } +.svg-card, .svg-x-small, .svg-small, .svg-medium, .svg-large { flex-shrink: 0; } .svg-mask { position: absolute; @@ -716,6 +718,7 @@ a.no-line { .cursor-inherit { cursor: inherit; } .pointer-events-none { pointer-events: none; } +.content-pointer-events-none > * { pointer-events: none; } .select-text { user-select: text; } .select-text-i { user-select: text !important; } diff --git a/plugins/contact-resources/src/components/CombineAvatars.svelte b/plugins/contact-resources/src/components/CombineAvatars.svelte index 8384071458..71b1f59a3b 100644 --- a/plugins/contact-resources/src/components/CombineAvatars.svelte +++ b/plugins/contact-resources/src/components/CombineAvatars.svelte @@ -23,6 +23,7 @@ export let items: Ref[] = [] export let size: IconSize export let limit: number = 3 + export let hideLimit: boolean = false let persons: Contact[] = [] const query = createQuery() @@ -37,8 +38,13 @@
- {#each persons as person} -
+ {#each persons as person, i} +
limit && !hideLimit + ? `+${items.length - limit + 1}` + : undefined} + >
{/each} @@ -52,9 +58,18 @@ .combine-avatar.inline:not(:first-child) { margin-left: calc(1px - (0.875rem / 2)); } + .combine-avatar.tiny:not(:first-child) { + margin-left: calc(1px - (1.13rem / 2)); + } + .combine-avatar.card:not(:first-child) { + margin-left: calc(1px - (1.25rem / 2)); + } .combine-avatar.x-small:not(:first-child) { margin-left: calc(1px - (1.5rem / 2)); } + .combine-avatar.smaller:not(:first-child) { + margin-left: calc(1px - (1.75rem / 2)); + } .combine-avatar.small:not(:first-child) { margin-left: calc(1px - 1rem); } @@ -70,5 +85,36 @@ .combine-avatar:not(:last-child) { mask: radial-gradient(circle at 100% 50%, rgba(0, 0, 0, 0) 48.5%, rgb(0, 0, 0) 50%); } + .combine-avatar.inline, + .combine-avatar.tiny, + .combine-avatar.card, + .combine-avatar.x-small { + font-size: 0.625rem; + } + .combine-avatar[data-over^='+']:last-child { + position: relative; + &::after { + content: attr(data-over); + position: absolute; + top: 50%; + left: 50%; + color: var(--theme-caption-color); + transform: translate(-53%, -52%); + z-index: 2; + } + &::before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: var(--theme-bg-color); + border: 1px solid var(--theme-divider-color); + border-radius: 50%; + opacity: 0.9; + z-index: 1; + } + } } diff --git a/plugins/contact-resources/src/components/ContactList.svelte b/plugins/contact-resources/src/components/ContactList.svelte index e21164cd8d..905b384264 100644 --- a/plugins/contact-resources/src/components/ContactList.svelte +++ b/plugins/contact-resources/src/components/ContactList.svelte @@ -91,7 +91,7 @@ {#if contacts.length === 1} {:else} - + diff --git a/plugins/contact-resources/src/components/SelectAvatars.svelte b/plugins/contact-resources/src/components/SelectAvatars.svelte new file mode 100644 index 0000000000..4aaf0e8e2e --- /dev/null +++ b/plugins/contact-resources/src/components/SelectAvatars.svelte @@ -0,0 +1,81 @@ + + + + +
{} : addPerson} +> + {#if persons.length > 0} + + {:else} + + {/if} +
diff --git a/plugins/contact-resources/src/components/UserBoxItems.svelte b/plugins/contact-resources/src/components/UserBoxItems.svelte new file mode 100644 index 0000000000..8b84d5134e --- /dev/null +++ b/plugins/contact-resources/src/components/UserBoxItems.svelte @@ -0,0 +1,124 @@ + + + +
+
+ {#each persons as person} +
+ + removePerson(person)} + /> +
+ {/each} +
+ {#if !readonly} + +
0} + on:click={addPerson} + > + + +
+ {/if} +
+ + diff --git a/plugins/contact-resources/src/components/UserBoxList.svelte b/plugins/contact-resources/src/components/UserBoxList.svelte index 1638258895..6ae4437eeb 100644 --- a/plugins/contact-resources/src/components/UserBoxList.svelte +++ b/plugins/contact-resources/src/components/UserBoxList.svelte @@ -16,7 +16,8 @@ import contact, { Employee } from '@hcengineering/contact' import type { Class, DocumentQuery, Ref } from '@hcengineering/core' import type { IntlString } from '@hcengineering/platform' - import { Button, ButtonKind, ButtonSize, Label, showPopup, TooltipAlignment } from '@hcengineering/ui' + import { Button, Label, showPopup } from '@hcengineering/ui' + import type { ButtonKind, ButtonSize, TooltipAlignment } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import plugin from '../plugin' import { employeeByIdStore } from '../utils' @@ -86,7 +87,7 @@ {#if persons.length === 1} {:else} - + diff --git a/plugins/contact-resources/src/components/icons/AddAvatar.svelte b/plugins/contact-resources/src/components/icons/AddAvatar.svelte new file mode 100644 index 0000000000..c4142e40a5 --- /dev/null +++ b/plugins/contact-resources/src/components/icons/AddAvatar.svelte @@ -0,0 +1,82 @@ + + + + + + + + + + + + diff --git a/plugins/contact-resources/src/index.ts b/plugins/contact-resources/src/index.ts index 87aa719578..b1e47eb335 100644 --- a/plugins/contact-resources/src/index.ts +++ b/plugins/contact-resources/src/index.ts @@ -73,6 +73,8 @@ import IconMembers from './components/icons/Members.svelte' import ChannelPresenter from './components/ChannelPresenter.svelte' import ChannelPanel from './components/ChannelPanel.svelte' import ActivityChannelPresenter from './components/activity/ActivityChannelPresenter.svelte' +import SelectAvatars from './components/SelectAvatars.svelte' +import UserBoxItems from './components/UserBoxItems.svelte' import contact from './plugin' import { @@ -122,7 +124,9 @@ export { SpaceMembers, CombineAvatars, UserInfo, - IconMembers + IconMembers, + SelectAvatars, + UserBoxItems } const toObjectSearchResult = (e: WithLookup): ObjectSearchResult => ({ @@ -286,7 +290,9 @@ export default async (): Promise => ({ ChannelPresenter, ChannelPanel, ActivityChannelPresenter, - SpaceMembers + SpaceMembers, + SelectAvatars, + UserBoxItems }, completion: { EmployeeQuery: async (