From 2387c52897e9a73acf6f5e4a25aafaa440fd89ec Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Mon, 25 Mar 2024 09:26:29 +0300 Subject: [PATCH] Updated office layout (#5051) Signed-off-by: Alexander Platov --- packages/theme/styles/_layouts.scss | 4 +++ packages/theme/styles/components.scss | 28 +++++++++++++++++-- packages/theme/styles/panel.scss | 12 +++++++- .../ui/src/components/AccordionItem.svelte | 26 +++++++++++++++-- packages/ui/src/components/ButtonBase.svelte | 2 +- packages/ui/src/components/NavGroup.svelte | 25 ++++++++++------- packages/ui/src/resize.ts | 1 + .../src/components/Workbench.svelte | 2 +- 8 files changed, 82 insertions(+), 18 deletions(-) diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index cfcac303b0..f993c32cd6 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -810,6 +810,10 @@ input.search { &:active { color: var(--theme-caption-color); } } +.will-change-opacity { + will-change: opacity; +} + /* Link */ a.no-line { text-decoration: none; diff --git a/packages/theme/styles/components.scss b/packages/theme/styles/components.scss index 93fee71c41..b0743e7b76 100644 --- a/packages/theme/styles/components.scss +++ b/packages/theme/styles/components.scss @@ -45,8 +45,10 @@ } .hulyComponent-content { flex-shrink: 0; - max-width: 64rem; + &:not(.withoutMaxWidth) { + max-width: 64rem; + } &.gap { gap: var(--spacing-4); } @@ -315,6 +317,9 @@ border: none; outline: none; + &.disabled { + cursor: default; + } &__label-wrapper { display: flex; align-items: center; @@ -372,11 +377,30 @@ font-weight: 400; } + &.categoryHeader { + position: sticky; + top: 0; + z-index: 1; + } + &.selectable.large { + .hulyAccordionItem-header__label-wrapper { + gap: var(--spacing-0_25); + } + .hulyAccordionItem-header__label { + padding: var(--spacing-0_5) var(--spacing-1); + border-radius: var(--extra-small-BorderRadius); + } + &.selected .hulyAccordionItem-header__label, + .hulyAccordionItem-header__label:hover { + background-color: var(--global-ui-hover-BackgroundColor); + } + } + &.small, &.medium { padding: var(--spacing-1) var(--spacing-2); min-height: var(--global-medium-Size); - + .hulyAccordionItem-header__label-wrapper { padding: var(--spacing-0_25) var(--spacing-0_5); color: var(--global-tertiary-TextColor); diff --git a/packages/theme/styles/panel.scss b/packages/theme/styles/panel.scss index 6446e5670d..ace23fea6f 100644 --- a/packages/theme/styles/panel.scss +++ b/packages/theme/styles/panel.scss @@ -38,11 +38,21 @@ margin-top: 0.75rem; } .hulyNavPanel-header { - padding: 1rem 1.25rem 1.5rem; + flex-shrink: 0; font-weight: 700; font-size: 1.25rem; line-height: 1.5rem; color: var(--global-primary-TextColor); + + &:not(.withButton) { padding: 1rem 1.25rem 1.5rem; } + &.withButton { + display: flex; + justify-content: space-between; + padding: .75rem .75rem 1.5rem 1.25rem; + min-width: 0; + min-height: 0; + } + &.small { padding-bottom: .75rem; } } .hulySidePanel-container { display: flex; diff --git a/packages/ui/src/components/AccordionItem.svelte b/packages/ui/src/components/AccordionItem.svelte index 0a7c57e041..64cd04b046 100644 --- a/packages/ui/src/components/AccordionItem.svelte +++ b/packages/ui/src/components/AccordionItem.svelte @@ -14,6 +14,7 @@ --> @@ -50,11 +59,14 @@ class="hulyAccordionItem-header {kind} {size}" class:bottomSpace class:nested + class:disabled class:isOpen={!collapsed} class:selected + class:selectable class:scroller-header={fixHeader} + class:categoryHeader style:background-color={background ?? 'transparent'} - on:click={handleClick} + on:click|stopPropagation={handleClick} >
{/if} - + + +
{ + if (selectable) dispatch('select') + else handleClick() + }} + > {#if label}
{#if counter !== false} diff --git a/packages/ui/src/components/ButtonBase.svelte b/packages/ui/src/components/ButtonBase.svelte index 5197c0c2d9..d422b54900 100644 --- a/packages/ui/src/components/ButtonBase.svelte +++ b/packages/ui/src/components/ButtonBase.svelte @@ -88,7 +88,7 @@ class:menu={hasMenu} disabled={loading || disabled} use:tp={tooltip} - on:click + on:click|stopPropagation on:keydown > {#if loading} diff --git a/packages/ui/src/components/NavGroup.svelte b/packages/ui/src/components/NavGroup.svelte index 57ca759a32..ffcfb4134a 100644 --- a/packages/ui/src/components/NavGroup.svelte +++ b/packages/ui/src/components/NavGroup.svelte @@ -17,7 +17,8 @@ import type { AnyComponent } from '..' import { Label, Component } from '..' - export let label: IntlString + export let label: IntlString | undefined = undefined + export let title: string | undefined = undefined export let categoryName: string export let tools: AnyComponent | undefined = undefined export let isOpen: boolean = true @@ -31,18 +32,22 @@ diff --git a/packages/ui/src/resize.ts b/packages/ui/src/resize.ts index 5b8f80fad1..eb706f39f5 100644 --- a/packages/ui/src/resize.ts +++ b/packages/ui/src/resize.ts @@ -163,6 +163,7 @@ export const settingsSeparators: DefSeparators = [ null, { minSize: 19, size: 30, maxSize: 32, float: 'aside' } ] +export const loveSeparators: DefSeparators = [{ minSize: 26, size: 27, maxSize: 28, float: 'navigator' }, null] export const secondNavSeparators: DefSeparators = [{ minSize: 7, size: 7.5, maxSize: 15, float: 'navigator' }, null] diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index 04e984c3b8..8d854278fd 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -616,7 +616,7 @@ defineSeparators('workbench', workbenchSeparators) let modern: boolean - $: modern = ['setting', 'time'].some((app) => currentApplication?.alias === app) + $: modern = ['setting', 'time', 'love'].some((app) => currentApplication?.alias === app) {#if employee && !employee.active}