-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
198 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
<script setup lang="ts"> | ||
import { Icon } from '@iconify/vue' | ||
import { computed } from 'vue' | ||
export interface TabProps { | ||
disabled?: boolean | ||
id?: string | ||
label: string | ||
label?: string | ||
icon?: string | ||
} | ||
const props = defineProps<TabProps>() | ||
const id = computed(() => props.id ?? props.label) | ||
</script> | ||
|
||
<template> | ||
<button | ||
class="vui-tab" | ||
:data-tab-id="id" | ||
:data-tab-id="label" | ||
:class="{ disabled: props.disabled }" | ||
role="tab" | ||
:name="id" | ||
:name="label" | ||
> | ||
<Icon v-if="props.icon" :icon="props.icon" /> | ||
{{ props.label }} | ||
<slot> | ||
<Icon v-if="props.icon" :icon="props.icon" /> | ||
{{ props.label }} | ||
</slot> | ||
</button> | ||
</template> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script setup lang='ts'> | ||
import Button from '../components/Button/Button.vue' | ||
import CopyClipboard from '../components/CopyClipboard/CopyClipboard.vue' | ||
import Flex from '../components/Flex/Flex.vue' | ||
</script> | ||
|
||
<template> | ||
<div class="mb-xxl"> | ||
<h3 class="mb-l"> | ||
Clipboard copy | ||
</h3> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>Base</th> | ||
<td> | ||
<CopyClipboard text="Copy me!"> | ||
<p>Copy me!</p> | ||
</CopyClipboard> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Custom slot & confirmation</th> | ||
<td> | ||
<CopyClipboard text="Copy me!" confirm> | ||
<Button>Copy me!</Button> | ||
</CopyClipboard> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Custom confirm popup</th> | ||
<td> | ||
<CopyClipboard text="Copy me!" confirm> | ||
<Button>Copy me!</Button> | ||
<template #confirm> | ||
<Flex column gap="s" align-center> | ||
<strong>The dawg</strong> | ||
<img style="width:128px;border-radius:8px" src="https://i.imgur.com/jMxIs6p.png" alt=""> | ||
</Flex> | ||
</template> | ||
</CopyClipboard> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</template> |
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,119 @@ | ||
<script setup lang='ts'> | ||
import { Icon } from '@iconify/vue' | ||
import { ref } from 'vue' | ||
import Button from '../components/Button/Button.vue' | ||
import Tab from '../components/Tabs/Tab.vue' | ||
import Tabs from '../components/Tabs/Tabs.vue' | ||
const activeTab = ref('Home') | ||
</script> | ||
|
||
<template> | ||
<div class="mb-xxl"> | ||
<h3 class="mb-l"> | ||
Tabs | ||
</h3> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>Base</th> | ||
<td> | ||
<Tabs v-model="activeTab"> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
</Tabs> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Filled</th> | ||
<td> | ||
<Tabs v-model="activeTab" variant="filled"> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
</Tabs> | ||
</td> | ||
</tr> | ||
<tr class="w-100"> | ||
<th>Expanded</th> | ||
<td class="w-100"> | ||
<Tabs v-model="activeTab" expand> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
</Tabs> | ||
|
||
<div class="mb-xl" /> | ||
|
||
<Tabs v-model="activeTab" expand variant="filled"> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
</Tabs> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>With slots</th> | ||
<td class="w-100"> | ||
<Tabs v-model="activeTab"> | ||
<template #start> | ||
<Button> | ||
<template #start> | ||
<Icon icon="ph:sidebar" /> | ||
</template> | ||
Sidebar | ||
</Button> | ||
</template> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
</Tabs> | ||
|
||
<div class="mb-xl" /> | ||
|
||
<Tabs v-model="activeTab" variant="filled"> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
|
||
<template #end> | ||
<Button icon="ph:x" plain /> | ||
</template> | ||
</Tabs> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>With slots expanded</th> | ||
<td class="w-100"> | ||
<Tabs v-model="activeTab" expand> | ||
<template #start> | ||
<Button> | ||
<template #start> | ||
<Icon icon="ph:sidebar" /> | ||
</template> | ||
Sidebar | ||
</Button> | ||
</template> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
</Tabs> | ||
|
||
<div class="mb-xl" /> | ||
|
||
<Tabs v-model="activeTab" expand variant="filled"> | ||
<Tab label="Home" /> | ||
<Tab label="About" /> | ||
<Tab label="You" /> | ||
|
||
<template #end> | ||
<Button icon="ph:x" plain /> | ||
</template> | ||
</Tabs> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</template> |