budibase/packages/builder/src/components/userInterface/ComponentSelectionList.svelte

56 lines
1.1 KiB
Svelte
Raw Normal View History

<script>
// This should be fetched from somewhere in the future, rather than be hardcoded.
import components from "./temporaryPanelStructure.js"
import Tab from "./ComponentTab/Tab.svelte"
import { store } from "builderStore"
const categories = components.categories
let selectedCategory = categories[0]
</script>
<div class="root">
<ul class="tabs">
{#each categories as category}
<li
on:click={() => (selectedCategory = category)}
class:active={selectedCategory === category}>
{category.name}
2020-02-19 22:38:21 +01:00
</li>
{/each}
</ul>
<div class="panel">
<Tab list={selectedCategory} />
2020-02-19 22:38:21 +01:00
</div>
</div>
<style>
.tabs {
display: flex;
justify-content: center;
list-style: none;
margin: 0 auto;
padding: 0 30px;
border-bottom: 1px solid #d8d8d8;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.14px;
}
2020-02-03 10:50:30 +01:00
li {
color: #808192;
margin: 0 5px;
padding: 0 8px;
cursor: pointer;
}
.panel {
padding: 20px;
}
2020-02-18 20:24:18 +01:00
.active {
border-bottom: solid 3px #0055ff;
color: #393c44;
2020-02-18 20:24:18 +01:00
}
</style>