-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into vault_burn_design_fix
- Loading branch information
Showing
23 changed files
with
420 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/bridge-ui/src/components/DialogTabs/DialogTab.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher } from 'svelte'; | ||
import { classNames } from '$libs/util/classNames'; | ||
const dispatch = createEventDispatcher(); | ||
export let active: boolean; | ||
function onClick() { | ||
dispatch('click'); | ||
} | ||
</script> | ||
|
||
<button | ||
role="tab" | ||
aria-selected={active} | ||
class:tab-active={active} | ||
class={classNames('tab !border-color-red', active ? 'tab-active ' : '')} | ||
on:click={onClick}> | ||
<slot></slot> | ||
</button> | ||
|
||
<style> | ||
.tab { | ||
box-sizing: border-box !important; | ||
padding-bottom: 6px; | ||
} | ||
.tab:not(.tab-active) { | ||
border-color: var(--tertiary-content) !important; | ||
border-bottom: 1px solid; | ||
margin-bottom: 2px; | ||
padding-top: 2px; | ||
} | ||
.tab-active { | ||
border-bottom: 4px solid; | ||
border-color: var(--primary-brand) !important; | ||
padding-bottom: 4px; | ||
} | ||
</style> |
24 changes: 24 additions & 0 deletions
24
packages/bridge-ui/src/components/DialogTabs/DialogTabs.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher } from 'svelte'; | ||
import DialogTab from './DialogTab.svelte'; | ||
export let tabs: { id: string; title: string }[]; | ||
export let activeTab: string; | ||
const dispatch = createEventDispatcher(); | ||
function setActiveTab(tabId: string) { | ||
if (activeTab !== tabId) { | ||
activeTab = tabId; | ||
dispatch('change', { tabId }); | ||
} | ||
} | ||
</script> | ||
|
||
<div role="tablist" class="tabs"> | ||
{#each tabs as tab} | ||
<DialogTab active={tab.id === activeTab} on:click={() => setActiveTab(tab.id)}> | ||
{tab.title} | ||
</DialogTab> | ||
{/each} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as DialogTab } from './DialogTab.svelte'; | ||
export { default as DialogTabs } from './DialogTabs.svelte'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.