Update new component blocks section to match designs

This commit is contained in:
Andrew Kingston 2022-04-26 11:04:31 +01:00
parent f9c22771f0
commit c46501709b
2 changed files with 48 additions and 16 deletions

View File

@ -9,6 +9,7 @@
DetailSummary,
Icon,
Body,
Divider,
} from "@budibase/bbui"
import structure from "./componentStructure.json"
import { store } from "builderStore"
@ -22,6 +23,7 @@
section,
searchString
)
$: blocks = enrichedStructure.find(x => x.name === "Blocks").children
const enrichStructure = (structure, definitions) => {
let enrichedStructure = []
@ -95,12 +97,20 @@
on:click={() => (section = "blocks")}>Blocks</ActionButton
>
</ActionGroup>
</Layout>
<div>
<Divider noMargin noGrid />
</div>
{#if section === "components"}
<Layout paddingX="L" paddingY="XL">
<Search
placeholder="Search"
value={searchString}
on:change={e => (searchString = e.detail)}
/>
</Layout>
{/if}
{#if section === "components"}
{#each filteredStructure as category}
<DetailSummary name={category.name} collapsible={false}>
<div class="component-grid">
@ -113,6 +123,19 @@
</div>
</DetailSummary>
{/each}
{:else}
<Layout paddingX="L" paddingY="XL" gap="S">
<Body size="S">Blocks are a collection of pre-built components</Body>
<Layout noPadding gap="XS">
{#each blocks as block}
<div class="component block">
<Icon name={block.icon} />
<Body size="XS">{block.name}</Body>
</div>
{/each}
</Layout>
</Layout>
{/if}
</NavigationPanel>
<style>
@ -142,4 +165,11 @@
cursor: pointer;
background: var(--spectrum-alias-background-color-tertiary);
}
.block {
flex-direction: row;
justify-content: flex-start;
height: 48px;
padding: 0 var(--spacing-l);
gap: var(--spacing-m);
}
</style>

View File

@ -6,7 +6,9 @@
<NavigationPanel title="Theme">
<Layout paddingX="L" paddingY="XL" gap="S">
<Body>Your theme is set across all the screens within your app</Body>
<Body size="S">
Your theme is set across all the screens within your app
</Body>
<ThemeEditor />
</Layout>
</NavigationPanel>