From d36a80b0de6e15662ba9504f583b77f8b3a2c2cd Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 23 Apr 2021 11:30:17 +0100 Subject: [PATCH] Update top nav to use tabs and fix a few tab layout issues --- packages/bbui/src/Tabs/Tab.svelte | 10 ++- packages/bbui/src/Tabs/Tabs.svelte | 7 +- .../pages/builder/[application]/_reset.svelte | 68 ++++++++----------- 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/packages/bbui/src/Tabs/Tab.svelte b/packages/bbui/src/Tabs/Tab.svelte index d82ebd7343..b2637f2784 100644 --- a/packages/bbui/src/Tabs/Tab.svelte +++ b/packages/bbui/src/Tabs/Tab.svelte @@ -1,9 +1,10 @@
($selected = { ...$selected, title, info: tab.getBoundingClientRect() })} + on:click={onClick} class:is-selected={$selected.title === title} class="spectrum-Tabs-item" tabindex="0"> diff --git a/packages/bbui/src/Tabs/Tabs.svelte b/packages/bbui/src/Tabs/Tabs.svelte index 3accd87e8f..7cd3e50b18 100644 --- a/packages/bbui/src/Tabs/Tabs.svelte +++ b/packages/bbui/src/Tabs/Tabs.svelte @@ -33,10 +33,8 @@ function calculateIndicatorOffset() { if (!vertical) { left = $tab.info?.left - container?.getBoundingClientRect().left + "px" - top = $tab.info?.top } else { top = $tab.info?.top - container?.getBoundingClientRect().top + "px" - left = $tab.info?.left } } @@ -72,6 +70,8 @@ .spectrum-Tabs { padding-left: var(--spacing-xl); padding-right: var(--spacing-xl); + position: relative; + border-width: 1px !important; } .spectrum-Tabs-content { margin-top: var(--spectrum-global-dimension-static-size-150); @@ -79,4 +79,7 @@ .indicator-transition { transition: all 200ms; } + .spectrum-Tabs--horizontal .spectrum-Tabs-selectionIndicator { + bottom: 0 !important; + } diff --git a/packages/builder/src/pages/builder/[application]/_reset.svelte b/packages/builder/src/pages/builder/[application]/_reset.svelte index d6eba33c96..8c778a70c4 100644 --- a/packages/builder/src/pages/builder/[application]/_reset.svelte +++ b/packages/builder/src/pages/builder/[application]/_reset.svelte @@ -1,18 +1,22 @@