Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jul 27, 2023
1 parent 0b186df commit 5fb527d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const items = [{
<template>
<UTabs :items="items" class="w-full">
<template #default="{ item, index, selected }">
<div class="flex items-center gap-2 relative">
<div class="flex items-center gap-2 relative truncate">
<UIcon :name="item.icon" class="w-4 h-4 flex-shrink-0" />

<span class="truncate">{{ index + 1 }}. {{ item.label }}</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/examples/TabsExampleVertical.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const items = [{
</script>

<template>
<UTabs :items="items" orientation="vertical" />
<UTabs :items="items" orientation="vertical" :ui="{ wrapper: 'flex items-center gap-4', list: { width: 'w-48' } }" />
</template>
6 changes: 4 additions & 2 deletions docs/content/5.navigation/4.tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/navigation/Tabs.vue
navigation:
badge: Edge
---

## Usage
Expand Down Expand Up @@ -56,7 +58,7 @@ const items = [...]
</script>
<template>
<UTabs :items="items" orientation="vertical" />
<UTabs :items="items" orientation="vertical" :ui="{ wrapper: 'flex items-center gap-4', list: { width: 'w-48' } }" />
</template>
```
::
Expand Down Expand Up @@ -114,7 +116,7 @@ const items = [{
<template>
<UTabs :items="items" class="w-full">
<template #default="{ item, index, selected }">
<div class="flex items-center gap-2 relative">
<div class="flex items-center gap-2 relative truncate">
<UIcon :name="item.icon" class="w-4 h-4 flex-shrink-0" />
<span class="truncate">{{ index + 1 }}. {{ item.label }}</span>
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,12 +769,13 @@ const tabs = {
container: 'relative w-full',
base: 'focus:outline-none',
list: {
base: 'relative w-full',
base: 'relative',
background: 'bg-gray-100 dark:bg-gray-800',
rounded: 'rounded-lg',
shadow: '',
padding: 'p-1',
height: 'h-10',
width: 'w-full',
marker: {
wrapper: 'absolute top-[4px] left-[4px] duration-200 ease-out focus:outline-none',
base: 'w-full h-full',
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/navigation/Tabs.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<HTabGroup :vertical="orientation === 'vertical'" :default-index="defaultIndex" as="div" :class="ui.wrapper" @change="onChange">
<HTabList
:class="[ui.list.base, ui.list.background, ui.list.rounded, ui.list.shadow, ui.list.padding, orientation === 'horizontal' && ui.list.height, orientation === 'horizontal' && 'inline-grid items-center']"
:class="[ui.list.base, ui.list.background, ui.list.rounded, ui.list.shadow, ui.list.padding, ui.list.width, orientation === 'horizontal' && ui.list.height, orientation === 'horizontal' && 'inline-grid items-center']"
:style="[orientation === 'horizontal' && `grid-template-columns: repeat(${items.length}, minmax(0, 1fr))`]"
>
<div ref="markerRef" :class="ui.list.marker.wrapper">
Expand Down

0 comments on commit 5fb527d

Please sign in to comment.