chore: migrate to https://ui.nuxt.com and @nuxt/ui (#616)

This commit is contained in:
Benjamin Canac
2023-09-07 14:26:12 +02:00
parent 9f9d8f5cec
commit 22f7536154
58 changed files with 112 additions and 113 deletions

View File

@@ -3,7 +3,7 @@ description: Display an input field.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Input.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Input.vue
---
## Usage

View File

@@ -3,7 +3,7 @@ description: Collect and validate form data.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Form.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Form.vue
---
## Usage
@@ -25,7 +25,7 @@ The Form component requires the `validate` and `state` props for form validation
```vue
<script setup lang="ts">
import { ref } from 'vue'
import type { FormError, FormSubmitEvent } from '@nuxthq/ui/dist/runtime/types'
import type { FormError, FormSubmitEvent } from '@nuxt/ui/dist/runtime/types'
const state = ref({
email: undefined,
@@ -82,7 +82,7 @@ You can provide a schema from [Yup](#yup), [Zod](#zod) or [Joi](#joi) through th
<script setup lang="ts">
import { ref } from 'vue'
import { object, string, InferType } from 'yup'
import type { FormSubmitEvent } from '@nuxthq/ui/dist/runtime/types'
import type { FormSubmitEvent } from '@nuxt/ui/dist/runtime/types'
const schema = object({
email: string().email('Invalid email').required('Required'),
@@ -137,7 +137,7 @@ async function submit (event: FormSubmitEvent<Schema>) {
<script setup lang="ts">
import { ref } from 'vue'
import { z } from 'zod'
import type { FormSubmitEvent } from '@nuxthq/ui/dist/runtime/types'
import type { FormSubmitEvent } from '@nuxt/ui/dist/runtime/types'
const schema = z.object({
email: z.string().email('Invalid email'),
@@ -190,7 +190,7 @@ async function submit (event: FormSubmitEvent<Schema>) {
<script setup lang="ts">
import { ref } from 'vue'
import Joi from 'joi'
import type { FormSubmitEvent } from '@nuxthq/ui/dist/runtime/types'
import type { FormSubmitEvent } from '@nuxt/ui/dist/runtime/types'
const schema = Joi.object({
email: Joi.string().required(),
@@ -279,7 +279,7 @@ You can manually set errors after form submission if required. To do this, simpl
```vue
<script setup lang="ts">
import type { FormError, FormSubmitEvent } from '@nuxthq/ui/dist/runtime/types'
import type { FormError, FormSubmitEvent } from '@nuxt/ui/dist/runtime/types'
const state = ref({
email: undefined,

View File

@@ -3,7 +3,7 @@ description: Display a textarea field.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Textarea.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Textarea.vue
---
## Usage

View File

@@ -3,7 +3,7 @@ description: Display a select field.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Select.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Select.vue
---
## Usage
@@ -30,7 +30,7 @@ const country = ref(countries[0])
```
::
When using objects, you can configure which field will be used for display through the `option-attribute` prop that defaults to `label` and which field will be used for comparison through the `value-attribute` prop that defaults to `value`.
When using objects, you can configure which field will be used for display through the `option-attribute` prop that defaults to `label` and which field will be used for comparison through the `value-attribute` prop that defaults to `value`.
Adding a `disabled` key to the objects will control the disabled state of the option.

View File

@@ -4,7 +4,7 @@ description: Display a select menu with advanced features.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/SelectMenu.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/SelectMenu.vue
- label: 'Listbox'
icon: i-simple-icons-headlessui
to: 'https://headlessui.com/vue/listbox'

View File

@@ -3,7 +3,7 @@ description: Display a checkbox field.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Checkbox.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Checkbox.vue
---
## Usage

View File

@@ -3,7 +3,7 @@ description: Display a radio field.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Radio.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Radio.vue
---
## Usage

View File

@@ -3,7 +3,7 @@ description: Display a toggle field.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Toggle.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Toggle.vue
- label: 'Switch'
icon: i-simple-icons-headlessui
to: 'https://headlessui.com/vue/switch'

View File

@@ -3,7 +3,7 @@ description: Display a range field
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Range.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/Range.vue
---
## Usage

View File

@@ -4,7 +4,7 @@ description: Display a label and additional informations around a form element.
links:
- label: GitHub
icon: i-simple-icons-github
to: https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/FormGroup.vue
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/forms/FormGroup.vue
---