docs: fix component rendering

This commit is contained in:
Sven Parker 2024-03-04 12:35:35 +01:00
parent bfe4c3d3c2
commit f3a3c08efc
4 changed files with 23 additions and 10 deletions

View File

@ -633,6 +633,13 @@ export const Index = {
component: () => import("../src/lib/registry/default/example/SliderDemo.vue").then((m) => m.default), component: () => import("../src/lib/registry/default/example/SliderDemo.vue").then((m) => m.default),
files: ["../src/lib/registry/default/example/SliderDemo.vue"], files: ["../src/lib/registry/default/example/SliderDemo.vue"],
}, },
"SliderForm": {
name: "SliderForm",
type: "components:example",
registryDependencies: ["button","form","select","toast"],
component: () => import("../src/lib/registry/default/example/SliderForm.vue").then((m) => m.default),
files: ["../src/lib/registry/default/example/SliderForm.vue"],
},
"SonnerDemo": { "SonnerDemo": {
name: "SonnerDemo", name: "SonnerDemo",
type: "components:example", type: "components:example",
@ -1600,6 +1607,13 @@ export const Index = {
component: () => import("../src/lib/registry/new-york/example/SliderDemo.vue").then((m) => m.default), component: () => import("../src/lib/registry/new-york/example/SliderDemo.vue").then((m) => m.default),
files: ["../src/lib/registry/new-york/example/SliderDemo.vue"], files: ["../src/lib/registry/new-york/example/SliderDemo.vue"],
}, },
"SliderForm": {
name: "SliderForm",
type: "components:example",
registryDependencies: ["button","form","select","toast"],
component: () => import("../src/lib/registry/new-york/example/SliderForm.vue").then((m) => m.default),
files: ["../src/lib/registry/new-york/example/SliderForm.vue"],
},
"SonnerDemo": { "SonnerDemo": {
name: "SonnerDemo", name: "SonnerDemo",
type: "components:example", type: "components:example",

View File

@ -1,11 +1,11 @@
--- ---
title: Slider title: Slider
description: An input where the user selects a value from within a given range. description: An input where the user selects a value from within a given range.
source: apps/www/src/lib/registry/default/ui/slider source: apps/www/src/lib/registry/default/ui/slider
primitive: https://www.radix-vue.com/components/slider.html primitive: https://www.radix-vue.com/components/slider.html
--- ---
<ComponentPreview name="SliderDemo" /> <ComponentPreview name="SliderDemo" />
## Installation ## Installation
@ -27,9 +27,8 @@ import { Slider } from '@/components/ui/slider'
</template> </template>
``` ```
## Examples ## Examples
### Form ### Form
<ComponentPreview name="SliderForm" /> <ComponentPreview name="SliderForm" />

View File

@ -18,8 +18,8 @@ import { toast } from '@/lib/registry/default/ui/toast'
const formSchema = toTypedSchema(z.object({ const formSchema = toTypedSchema(z.object({
duration: z.array( duration: z.array(
z.number().min(1).max(1440) z.number().min(0).max(60),
), ),
})) }))
const { handleSubmit } = useForm({ const { handleSubmit } = useForm({
@ -60,4 +60,4 @@ const onSubmit = handleSubmit((values) => {
Submit Submit
</Button> </Button>
</form> </form>
</template> </template>

View File

@ -18,8 +18,8 @@ import { toast } from '@/lib/registry/new-york/ui/toast'
const formSchema = toTypedSchema(z.object({ const formSchema = toTypedSchema(z.object({
duration: z.array( duration: z.array(
z.number().min(1).max(1440) z.number().min(0).max(60),
), ),
})) }))
const { handleSubmit } = useForm({ const { handleSubmit } = useForm({
@ -60,4 +60,4 @@ const onSubmit = handleSubmit((values) => {
Submit Submit
</Button> </Button>
</form> </form>
</template> </template>