diff --git a/packages/builder/src/components/userInterface/ComponentSelectionList.svelte b/packages/builder/src/components/userInterface/ComponentSelectionList.svelte
index 404cfa102b..463c8ea448 100644
--- a/packages/builder/src/components/userInterface/ComponentSelectionList.svelte
+++ b/packages/builder/src/components/userInterface/ComponentSelectionList.svelte
@@ -9,15 +9,22 @@
import Tab from "./ItemTab/Tab.svelte"
const categories = components.categories
- let selectedIndex
+ let selectedCategory
let width
- $: selectedCategory = selectedIndex == null ? null : categories[selectedIndex]
const close = () => {
- selectedIndex = null
+ selectedCategory = null
}
- const onComponentChosen = component => {
+ const onCategoryChosen = (category) => {
+ if (category.isCategory) {
+ selectedCategory = selectedCategory === category ? null : category
+ } else {
+ onComponentChosen(category)
+ }
+ }
+
+ const onComponentChosen = (component) => {
store.addChildComponent(component._component, component.presetProps)
// Get ID path
@@ -33,14 +40,15 @@
+ class:open={selectedCategory != null}>
{#each categories as category, idx}
(selectedIndex = idx)}
+ on:click={() => onCategoryChosen(category)}
class:active={selectedCategory === category}>
- {category.name}
-
+ {#if category.icon}{/if}
+ {category.name}
+ {#if category.isCategory}{/if}
{/each}
@@ -49,7 +57,7 @@
onComponentChosen(e.detail)} />
+ on:selectItem={(e) => onComponentChosen(e.detail)} />
{/if}
@@ -61,33 +69,40 @@
}
.container {
- padding: var(--spacing-xl) 40px;
+ padding: var(--spacing-l) 40px;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
background-color: white;
z-index: 1;
+ width: calc(100% - 80px);
+ overflow: hidden;
}
- .container.border {
- border-bottom: 1px solid var(--grey-2);
+ .container.open {
}
.category {
- color: var(--ink);
+ color: var(--grey-7);
cursor: pointer;
- margin-right: var(--spacing-xl);
+ margin-right: var(--spacing-l);
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
gap: var(--spacing-xs);
- font-size: var(--font-size-s);
+ font-size: var(--font-size-xs);
+ }
+ .category span {
font-weight: 500;
+ user-select: none;
}
.category.active,
.category:hover {
- color: var(--blue);
+ color: var(--ink);
+ }
+ .category i:not(:last-child) {
+ font-size: 16px;
}
.overlay {
@@ -107,7 +122,6 @@
width: calc(100% - 80px);
background-color: white;
padding: var(--spacing-xl) 40px;
- border-bottom: 1px solid var(--grey-2);
box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.05);
}
diff --git a/packages/builder/src/pages/[application]/design/_layout.svelte b/packages/builder/src/pages/[application]/design/_layout.svelte
index 420a1bd2ea..34126e3687 100644
--- a/packages/builder/src/pages/[application]/design/_layout.svelte
+++ b/packages/builder/src/pages/[application]/design/_layout.svelte
@@ -32,19 +32,18 @@
settingsView.show()
}
- const lastPartOfName = c => (c ? last(c.split("/")) : "")
+ const lastPartOfName = (c) => (c ? last(c.split("/")) : "")
-
{#if $store.currentPageName && $store.currentPageName.length > 0}
-
+
@@ -56,7 +55,6 @@
{/if}
-
@@ -64,8 +62,8 @@