docs: adding more examples for DropdownMenu and Select components
This commit is contained in:
parent
75cf9c40c4
commit
c487137ac5
|
|
@ -423,6 +423,13 @@ export const Index = {
|
|||
component: () => import("../src/lib/registry/default/example/DrawerDialog.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/default/example/DrawerDialog.vue"],
|
||||
},
|
||||
"DropdownMenuCheckboxes": {
|
||||
name: "DropdownMenuCheckboxes",
|
||||
type: "components:example",
|
||||
registryDependencies: ["button","dropdown-menu"],
|
||||
component: () => import("../src/lib/registry/default/example/DropdownMenuCheckboxes.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/default/example/DropdownMenuCheckboxes.vue"],
|
||||
},
|
||||
"DropdownMenuDemo": {
|
||||
name: "DropdownMenuDemo",
|
||||
type: "components:example",
|
||||
|
|
@ -430,6 +437,13 @@ export const Index = {
|
|||
component: () => import("../src/lib/registry/default/example/DropdownMenuDemo.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/default/example/DropdownMenuDemo.vue"],
|
||||
},
|
||||
"DropdownMenuRadioGroup": {
|
||||
name: "DropdownMenuRadioGroup",
|
||||
type: "components:example",
|
||||
registryDependencies: ["button","dropdown-menu"],
|
||||
component: () => import("../src/lib/registry/default/example/DropdownMenuRadioGroup.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/default/example/DropdownMenuRadioGroup.vue"],
|
||||
},
|
||||
"HoverCardDemo": {
|
||||
name: "HoverCardDemo",
|
||||
type: "components:example",
|
||||
|
|
@ -605,6 +619,13 @@ export const Index = {
|
|||
component: () => import("../src/lib/registry/default/example/SelectForm.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/default/example/SelectForm.vue"],
|
||||
},
|
||||
"SelectScrollable": {
|
||||
name: "SelectScrollable",
|
||||
type: "components:example",
|
||||
registryDependencies: ["select"],
|
||||
component: () => import("../src/lib/registry/default/example/SelectScrollable.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/default/example/SelectScrollable.vue"],
|
||||
},
|
||||
"SeparatorDemo": {
|
||||
name: "SeparatorDemo",
|
||||
type: "components:example",
|
||||
|
|
@ -1411,6 +1432,13 @@ export const Index = {
|
|||
component: () => import("../src/lib/registry/new-york/example/DrawerDialog.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/new-york/example/DrawerDialog.vue"],
|
||||
},
|
||||
"DropdownMenuCheckboxes": {
|
||||
name: "DropdownMenuCheckboxes",
|
||||
type: "components:example",
|
||||
registryDependencies: ["button","dropdown-menu"],
|
||||
component: () => import("../src/lib/registry/new-york/example/DropdownMenuCheckboxes.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/new-york/example/DropdownMenuCheckboxes.vue"],
|
||||
},
|
||||
"DropdownMenuDemo": {
|
||||
name: "DropdownMenuDemo",
|
||||
type: "components:example",
|
||||
|
|
@ -1418,6 +1446,13 @@ export const Index = {
|
|||
component: () => import("../src/lib/registry/new-york/example/DropdownMenuDemo.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/new-york/example/DropdownMenuDemo.vue"],
|
||||
},
|
||||
"DropdownMenuRadioGroup": {
|
||||
name: "DropdownMenuRadioGroup",
|
||||
type: "components:example",
|
||||
registryDependencies: ["button","dropdown-menu"],
|
||||
component: () => import("../src/lib/registry/new-york/example/DropdownMenuRadioGroup.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/new-york/example/DropdownMenuRadioGroup.vue"],
|
||||
},
|
||||
"HoverCardDemo": {
|
||||
name: "HoverCardDemo",
|
||||
type: "components:example",
|
||||
|
|
@ -1593,6 +1628,13 @@ export const Index = {
|
|||
component: () => import("../src/lib/registry/new-york/example/SelectForm.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/new-york/example/SelectForm.vue"],
|
||||
},
|
||||
"SelectScrollable": {
|
||||
name: "SelectScrollable",
|
||||
type: "components:example",
|
||||
registryDependencies: ["select"],
|
||||
component: () => import("../src/lib/registry/new-york/example/SelectScrollable.vue").then((m) => m.default),
|
||||
files: ["../src/lib/registry/new-york/example/SelectScrollable.vue"],
|
||||
},
|
||||
"SeparatorDemo": {
|
||||
name: "SeparatorDemo",
|
||||
type: "components:example",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ source: apps/www/src/lib/registry/default/ui/dropdown-menu
|
|||
primitive: https://www.radix-vue.com/components/dropdown-menu.html
|
||||
---
|
||||
|
||||
|
||||
<ComponentPreview name="DropdownMenuDemo" />
|
||||
|
||||
## Installation
|
||||
|
|
@ -41,3 +40,13 @@ import {
|
|||
</DropdownMenu>
|
||||
</template>
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Checkboxes
|
||||
|
||||
<ComponentPreview name="DropdownMenuCheckboxes" />
|
||||
|
||||
### Radio Group
|
||||
|
||||
<ComponentPreview name="DropdownMenuRadioGroup" />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ title: Input
|
|||
description: Displays a form input field or a component that looks like an input field.
|
||||
---
|
||||
|
||||
|
||||
<ComponentPreview name="InputDemo" class="max-w-xs" />
|
||||
|
||||
## Installation
|
||||
|
|
@ -26,8 +25,6 @@ npx shadcn-vue@latest add input
|
|||
|
||||
</Steps>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
</TabPreview>
|
||||
|
||||
|
|
@ -43,6 +40,8 @@ import { Input } from '@/components/ui/input'
|
|||
</template>
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Default
|
||||
|
||||
<ComponentPreview name="InputDemo" class="max-w-xs" />
|
||||
|
|
|
|||
|
|
@ -5,12 +5,10 @@ source: apps/www/src/lib/registry/default/ui/select
|
|||
primitive: https://www.radix-vue.com/components/select.html
|
||||
---
|
||||
|
||||
|
||||
<ComponentPreview name="SelectDemo" />
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
```bash
|
||||
npx shadcn-vue@latest add select
|
||||
```
|
||||
|
|
@ -49,6 +47,10 @@ import {
|
|||
|
||||
## Examples
|
||||
|
||||
### Scrollable
|
||||
|
||||
<ComponentPreview name="SelectScrollable" />
|
||||
|
||||
### Form
|
||||
|
||||
<ComponentPreview name="SelectForm" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
<script lang="ts" setup>
|
||||
import type { DropdownMenuCheckboxItemProps } from 'radix-vue'
|
||||
import { ref } from 'vue'
|
||||
import { Button } from '@/lib/registry/default/ui/button'
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuCheckboxItem,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/lib/registry/default/ui/dropdown-menu'
|
||||
|
||||
type Checked = DropdownMenuCheckboxItemProps['checked']
|
||||
|
||||
const showStatusBar = ref<Checked>(true)
|
||||
const showActivityBar = ref<Checked>(false)
|
||||
const showPanel = ref<Checked>(false)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button variant="outline">
|
||||
Open
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent class="w-56">
|
||||
<DropdownMenuLabel>Appearance</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuCheckboxItem
|
||||
v-model:checked="showStatusBar"
|
||||
>
|
||||
Status Bar
|
||||
</DropdownMenuCheckboxItem>
|
||||
<DropdownMenuCheckboxItem
|
||||
v-model:checked="showActivityBar"
|
||||
disabled
|
||||
>
|
||||
Activity Bar
|
||||
</DropdownMenuCheckboxItem>
|
||||
<DropdownMenuCheckboxItem
|
||||
v-model:checked="showPanel"
|
||||
>
|
||||
Panel
|
||||
</DropdownMenuCheckboxItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</template>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { Button } from '@/lib/registry/default/ui/button'
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuRadioGroup,
|
||||
DropdownMenuRadioItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/lib/registry/default/ui/dropdown-menu'
|
||||
|
||||
const position = ref('bottom')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button variant="outline">
|
||||
Open
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent class="w-56">
|
||||
<DropdownMenuLabel>Panel Position</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuRadioGroup v-model="position">
|
||||
<DropdownMenuRadioItem value="top">
|
||||
Top
|
||||
</DropdownMenuRadioItem>
|
||||
<DropdownMenuRadioItem value="bottom">
|
||||
Bottom
|
||||
</DropdownMenuRadioItem>
|
||||
<DropdownMenuRadioItem value="right">
|
||||
Right
|
||||
</DropdownMenuRadioItem>
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</template>
|
||||
117
apps/www/src/lib/registry/default/example/SelectScrollable.vue
Normal file
117
apps/www/src/lib/registry/default/example/SelectScrollable.vue
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<script lang="ts" setup>
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectLabel,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/lib/registry/default/ui/select'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Select>
|
||||
<SelectTrigger class="w-[280px]">
|
||||
<SelectValue placeholder="Select a timezone" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectLabel>North America</SelectLabel>
|
||||
<SelectItem value="est">
|
||||
Eastern Standard Time (EST)
|
||||
</SelectItem>
|
||||
<SelectItem value="cst">
|
||||
Central Standard Time (CST)
|
||||
</SelectItem>
|
||||
<SelectItem value="mst">
|
||||
Mountain Standard Time (MST)
|
||||
</SelectItem>
|
||||
<SelectItem value="pst">
|
||||
Pacific Standard Time (PST)
|
||||
</SelectItem>
|
||||
<SelectItem value="akst">
|
||||
Alaska Standard Time (AKST)
|
||||
</SelectItem>
|
||||
<SelectItem value="hst">
|
||||
Hawaii Standard Time (HST)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Europe & Africa</SelectLabel>
|
||||
<SelectItem value="gmt">
|
||||
Greenwich Mean Time (GMT)
|
||||
</SelectItem>
|
||||
<SelectItem value="cet">
|
||||
Central European Time (CET)
|
||||
</SelectItem>
|
||||
<SelectItem value="eet">
|
||||
Eastern European Time (EET)
|
||||
</SelectItem>
|
||||
<SelectItem value="west">
|
||||
Western European Summer Time (WEST)
|
||||
</SelectItem>
|
||||
<SelectItem value="cat">
|
||||
Central Africa Time (CAT)
|
||||
</SelectItem>
|
||||
<SelectItem value="eat">
|
||||
East Africa Time (EAT)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Asia</SelectLabel>
|
||||
<SelectItem value="msk">
|
||||
Moscow Time (MSK)
|
||||
</SelectItem>
|
||||
<SelectItem value="ist">
|
||||
India Standard Time (IST)
|
||||
</SelectItem>
|
||||
<SelectItem value="cst_china">
|
||||
China Standard Time (CST)
|
||||
</SelectItem>
|
||||
<SelectItem value="jst">
|
||||
Japan Standard Time (JST)
|
||||
</SelectItem>
|
||||
<SelectItem value="kst">
|
||||
Korea Standard Time (KST)
|
||||
</SelectItem>
|
||||
<SelectItem value="ist_indonesia">
|
||||
Indonesia Central Standard Time (WITA)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Australia & Pacific</SelectLabel>
|
||||
<SelectItem value="awst">
|
||||
Australian Western Standard Time (AWST)
|
||||
</SelectItem>
|
||||
<SelectItem value="acst">
|
||||
Australian Central Standard Time (ACST)
|
||||
</SelectItem>
|
||||
<SelectItem value="aest">
|
||||
Australian Eastern Standard Time (AEST)
|
||||
</SelectItem>
|
||||
<SelectItem value="nzst">
|
||||
New Zealand Standard Time (NZST)
|
||||
</SelectItem>
|
||||
<SelectItem value="fjt">
|
||||
Fiji Time (FJT)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>South America</SelectLabel>
|
||||
<SelectItem value="art">
|
||||
Argentina Time (ART)
|
||||
</SelectItem>
|
||||
<SelectItem value="bot">
|
||||
Bolivia Time (BOT)
|
||||
</SelectItem>
|
||||
<SelectItem value="brt">
|
||||
Brasilia Time (BRT)
|
||||
</SelectItem>
|
||||
<SelectItem value="clt">
|
||||
Chile Standard Time (CLT)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</template>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<script lang="ts" setup>
|
||||
import type { DropdownMenuCheckboxItemProps } from 'radix-vue'
|
||||
import { ref } from 'vue'
|
||||
import { Button } from '@/lib/registry/new-york/ui/button'
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuCheckboxItem,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/lib/registry/new-york/ui/dropdown-menu'
|
||||
|
||||
type Checked = DropdownMenuCheckboxItemProps['checked']
|
||||
|
||||
const showStatusBar = ref<Checked>(true)
|
||||
const showActivityBar = ref<Checked>(false)
|
||||
const showPanel = ref<Checked>(false)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button variant="outline">
|
||||
Open
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent class="w-56">
|
||||
<DropdownMenuLabel>Appearance</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuCheckboxItem
|
||||
v-model:checked="showStatusBar"
|
||||
>
|
||||
Status Bar
|
||||
</DropdownMenuCheckboxItem>
|
||||
<DropdownMenuCheckboxItem
|
||||
v-model:checked="showActivityBar"
|
||||
disabled
|
||||
>
|
||||
Activity Bar
|
||||
</DropdownMenuCheckboxItem>
|
||||
<DropdownMenuCheckboxItem
|
||||
v-model:checked="showPanel"
|
||||
>
|
||||
Panel
|
||||
</DropdownMenuCheckboxItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</template>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { Button } from '@/lib/registry/new-york/ui/button'
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuRadioGroup,
|
||||
DropdownMenuRadioItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/lib/registry/new-york/ui/dropdown-menu'
|
||||
|
||||
const position = ref('bottom')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button variant="outline">
|
||||
Open
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent class="w-56">
|
||||
<DropdownMenuLabel>Panel Position</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuRadioGroup v-model="position">
|
||||
<DropdownMenuRadioItem value="top">
|
||||
Top
|
||||
</DropdownMenuRadioItem>
|
||||
<DropdownMenuRadioItem value="bottom">
|
||||
Bottom
|
||||
</DropdownMenuRadioItem>
|
||||
<DropdownMenuRadioItem value="right">
|
||||
Right
|
||||
</DropdownMenuRadioItem>
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</template>
|
||||
117
apps/www/src/lib/registry/new-york/example/SelectScrollable.vue
Normal file
117
apps/www/src/lib/registry/new-york/example/SelectScrollable.vue
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<script lang="ts" setup>
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectLabel,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/lib/registry/new-york/ui/select'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Select>
|
||||
<SelectTrigger class="w-[280px]">
|
||||
<SelectValue placeholder="Select a timezone" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectLabel>North America</SelectLabel>
|
||||
<SelectItem value="est">
|
||||
Eastern Standard Time (EST)
|
||||
</SelectItem>
|
||||
<SelectItem value="cst">
|
||||
Central Standard Time (CST)
|
||||
</SelectItem>
|
||||
<SelectItem value="mst">
|
||||
Mountain Standard Time (MST)
|
||||
</SelectItem>
|
||||
<SelectItem value="pst">
|
||||
Pacific Standard Time (PST)
|
||||
</SelectItem>
|
||||
<SelectItem value="akst">
|
||||
Alaska Standard Time (AKST)
|
||||
</SelectItem>
|
||||
<SelectItem value="hst">
|
||||
Hawaii Standard Time (HST)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Europe & Africa</SelectLabel>
|
||||
<SelectItem value="gmt">
|
||||
Greenwich Mean Time (GMT)
|
||||
</SelectItem>
|
||||
<SelectItem value="cet">
|
||||
Central European Time (CET)
|
||||
</SelectItem>
|
||||
<SelectItem value="eet">
|
||||
Eastern European Time (EET)
|
||||
</SelectItem>
|
||||
<SelectItem value="west">
|
||||
Western European Summer Time (WEST)
|
||||
</SelectItem>
|
||||
<SelectItem value="cat">
|
||||
Central Africa Time (CAT)
|
||||
</SelectItem>
|
||||
<SelectItem value="eat">
|
||||
East Africa Time (EAT)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Asia</SelectLabel>
|
||||
<SelectItem value="msk">
|
||||
Moscow Time (MSK)
|
||||
</SelectItem>
|
||||
<SelectItem value="ist">
|
||||
India Standard Time (IST)
|
||||
</SelectItem>
|
||||
<SelectItem value="cst_china">
|
||||
China Standard Time (CST)
|
||||
</SelectItem>
|
||||
<SelectItem value="jst">
|
||||
Japan Standard Time (JST)
|
||||
</SelectItem>
|
||||
<SelectItem value="kst">
|
||||
Korea Standard Time (KST)
|
||||
</SelectItem>
|
||||
<SelectItem value="ist_indonesia">
|
||||
Indonesia Central Standard Time (WITA)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Australia & Pacific</SelectLabel>
|
||||
<SelectItem value="awst">
|
||||
Australian Western Standard Time (AWST)
|
||||
</SelectItem>
|
||||
<SelectItem value="acst">
|
||||
Australian Central Standard Time (ACST)
|
||||
</SelectItem>
|
||||
<SelectItem value="aest">
|
||||
Australian Eastern Standard Time (AEST)
|
||||
</SelectItem>
|
||||
<SelectItem value="nzst">
|
||||
New Zealand Standard Time (NZST)
|
||||
</SelectItem>
|
||||
<SelectItem value="fjt">
|
||||
Fiji Time (FJT)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
<SelectGroup>
|
||||
<SelectLabel>South America</SelectLabel>
|
||||
<SelectItem value="art">
|
||||
Argentina Time (ART)
|
||||
</SelectItem>
|
||||
<SelectItem value="bot">
|
||||
Bolivia Time (BOT)
|
||||
</SelectItem>
|
||||
<SelectItem value="brt">
|
||||
Brasilia Time (BRT)
|
||||
</SelectItem>
|
||||
<SelectItem value="clt">
|
||||
Chile Standard Time (CLT)
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</template>
|
||||
Loading…
Reference in New Issue
Block a user