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 4 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
6 changes: 3 additions & 3 deletions docs/components/docs/DocsPrevNext.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<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="prev.navigation?.icon" />
<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="next.navigation?.icon" />
</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 text-gray-700 transition-shadow bg-white border shadow not-prose rounded-xl border-gray-200 dark:border-gray-800 dark:bg-gray-800/25 hover:shadow-md dark:text-gray-300 dark:shadow-black/50 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-400/50 transition-colors">
<UIcon :name="icon" class="w-5 h-5 transition-colors text-gray-900 dark:text-gray-100 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 container for content with a header, body and footer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A container?

---

## 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 }
}
})