Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve page descriptions and prev/next #184

Merged
merged 7 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

<NuxtPage />

<hr class="border-gray-200 dark:border-gray-800 my-12">
<DocsPageFooter class="mt-12" />

<DocsPrevNext />
<hr class="border-gray-200 dark:border-gray-800 my-6">

<hr class="border-gray-200 dark:border-gray-800 my-12">
<DocsPrevNext />

<DocsPageFooter />
<DocsFooter class="mt-16" />
</div>

<DocsToc v-if="toc" class="lg:col-span-2 order-first lg:order-last" />
Expand Down
10 changes: 10 additions & 0 deletions docs/components/docs/DocsFooter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<footer class="flex items-center justify-end gap-1.5">
<div class="flex items-baseline gap-1.5 text-sm text-center text-gray-500 dark:text-gray-400">
Made by
<NuxtLink to="https://nuxtlabs.com" aria-label="NuxtLabs">
<LogoLabs class="text-white w-14 h-auto" />
</NuxtLink>
</div>
</footer>
</template>
17 changes: 5 additions & 12 deletions docs/components/docs/DocsPageFooter.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
<template>
<footer class="flex items-center justify-between gap-1.5">
<div class="flex items-center justify-between gap-1.5">
<UButton
v-if="page"
:to="`https://github.com/nuxtlabs/ui/edit/dev/docs/content/${page._file}`"
label="Edit on GitHub"
color="gray"
label="Edit this page on GitHub"
color="primary"
variant="link"
:padded="false"
trailing-icon="i-heroicons-arrow-top-right-on-square-20-solid"
icon="i-heroicons-arrow-top-right-on-square-20-solid"
/>

<div class="flex items-baseline gap-1.5 text-sm text-center text-gray-500 dark:text-gray-400">
Made by
<NuxtLink to="https://nuxtlabs.com" aria-label="NuxtLabs">
<LogoLabs class="text-white w-14 h-auto" />
</NuxtLink>
</div>
</footer>
</div>
</template>

<script setup lang="ts">
Expand Down
13 changes: 10 additions & 3 deletions docs/components/docs/DocsPrevNext.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<template>
<div class="flex items-center justify-between">
<UButton v-if="prev" :label="prev.navigation?.title || prev.title" :to="prev._path" icon="i-heroicons-arrow-small-left-20-solid" color="white" />
<div class="grid gap-8 sm:grid-cols-2">
<DocsPrevNextCard v-if="prev" :title="prev.navigation?.title || prev.title" :description="prev.navigation?.description || prev.description" :to="prev._path" icon="i-heroicons-arrow-left-20-solid" />
<span v-else>&nbsp;</span>
<UButton v-if="next" :label="next.navigation?.title || next.title" :to="next._path" trailing-icon="i-heroicons-arrow-small-right-20-solid" color="white" />
<DocsPrevNextCard
v-if="next"
:title="next.navigation?.title || next.title"
:description="next.navigation?.description || next.description"
:to="next._path"
icon="i-heroicons-arrow-right-20-solid"
class="text-right"
/>
</div>
</template>

Expand Down
36 changes: 36 additions & 0 deletions docs/components/docs/DocsPrevNextCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<NuxtLink :to="to" class="block px-5 py-8 border not-prose rounded-lg border-gray-200 dark:border-gray-800 hover:bg-gray-50 dark:hover:bg-gray-800/25 group">
<div v-if="icon" class="inline-flex items-center rounded-full p-1.5 bg-gray-50 dark:bg-gray-800 group-hover:bg-primary-50 dark:group-hover:bg-primary-400/10 ring-1 ring-gray-300 dark:ring-gray-700 mb-4 group-hover:ring-primary-500/50 dark:group-hover:ring-primary-400/50">
<UIcon :name="icon" class="w-5 h-5 text-gray-900 dark:text-gray-100 group-hover:text-primary-500 dark:group-hover:text-primary-400" />
</div>

<p class="text-gray-900 dark:text-gray-50 font-medium text-[15px] mb-1">
{{ title }}
</p>

<p class="text-sm font-normal text-gray-500 dark:text-gray-400">
{{ description }}
</p>
</NuxtLink>
</template>

<script setup lang="ts">
defineProps({
icon: {
type: String,
default: null
},
title: {
type: String,
default: ''
},
description: {
type: String,
default: ''
},
to: {
type: String,
required: true
}
})
</script>
1 change: 1 addition & 0 deletions docs/content/2.elements/1.avatar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display an image that represents a resource or a group of resources.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/2.elements/2.badge.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a short text to represent a status or a category.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/2.elements/3.button.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Create a button with icon or link capabilities.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/2.elements/4.dropdown.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a list of actions in a dropdown menu.
headlessui:
label: 'Menu'
to: 'https://headlessui.com/vue/menu'
Expand Down
1 change: 1 addition & 0 deletions docs/content/2.elements/5.icon.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display an icon from Iconify library.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/2.elements/6.kbd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
github: true
title: 'Keyboard Key'
description: Display a keyboard key in a text block.
navigation:
title: 'Kbd'
---
Expand Down
1 change: 1 addition & 0 deletions docs/content/3.forms/1.input.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display an input field.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/3.forms/2.textarea.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a textarea field.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/3.forms/3.select.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a select field.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/3.forms/4.select-menu.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a select menu with advanced features.
headlessui:
label: 'Listbox'
to: 'https://headlessui.com/vue/listbox'
Expand Down
1 change: 1 addition & 0 deletions docs/content/3.forms/5.checkbox.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a checkbox field.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/3.forms/6.radio.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a radio field.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/3.forms/7.toggle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a toggle field.
headlessui:
label: 'Switch'
to: 'https://headlessui.com/vue/switch'
Expand Down
1 change: 1 addition & 0 deletions docs/content/4.navigation/1.vertical-navigation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a vertical navigation.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/4.navigation/2.command-palette.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Add a customizable command palette to your app.
headlessui:
label: 'Combobox'
to: 'https://headlessui.com/vue/combobox'
Expand Down
1 change: 1 addition & 0 deletions docs/content/5.overlays/1.modal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a modal within your application.
headlessui:
label: 'Dialog'
to: 'https://headlessui.com/vue/dialog'
Expand Down
1 change: 1 addition & 0 deletions docs/content/5.overlays/2.slideover.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a dialog that slides in from the edge of the screen.
headlessui:
label: 'Dialog'
to: 'https://headlessui.com/vue/dialog'
Expand Down
1 change: 1 addition & 0 deletions docs/content/5.overlays/3.popover.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a non-modal dialog that floats around a trigger element.
headlessui:
label: 'Popover'
to: 'https://headlessui.com/vue/popover'
Expand Down
1 change: 1 addition & 0 deletions docs/content/5.overlays/4.tooltip.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display content that appears on hover next to an element.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/5.overlays/5.context-menu.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a menu that appears on right click.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/5.overlays/6.notification.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a toast notification in your app.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/6.layout/1.card.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a card for content with a header, body and footer.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/6.layout/2.container.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: A container lets you center and constrain the width of your content.
---

## Usage
Expand Down
1 change: 1 addition & 0 deletions docs/content/6.layout/3.skeleton.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
github: true
description: Display a placeholder while content is loading.
---

## Usage
Expand Down
3 changes: 3 additions & 0 deletions docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ export default defineNuxtConfig({
'/api/_content/**': { isr: true, static: true },
'/api/component-meta/**': { isr: true, static: true }
}
},
routeRules: {
// '/getting-started': { swr: 100000 }
}
})