From c487137ac5e5c687ba98b07926636d5476c681e2 Mon Sep 17 00:00:00 2001 From: Saeid Zareie <65568529+Saeid-Za@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:52:07 +0330 Subject: [PATCH] docs: adding more examples for `DropdownMenu` and `Select` components --- apps/www/__registry__/index.ts | 42 +++++++ .../content/docs/components/dropdown-menu.md | 19 ++- apps/www/src/content/docs/components/input.md | 7 +- .../www/src/content/docs/components/select.md | 10 +- .../example/DropdownMenuCheckboxes.vue | 49 ++++++++ .../example/DropdownMenuRadioGroup.vue | 40 ++++++ .../default/example/SelectScrollable.vue | 117 ++++++++++++++++++ .../example/DropdownMenuCheckboxes.vue | 49 ++++++++ .../example/DropdownMenuRadioGroup.vue | 40 ++++++ .../new-york/example/SelectScrollable.vue | 117 ++++++++++++++++++ 10 files changed, 477 insertions(+), 13 deletions(-) create mode 100644 apps/www/src/lib/registry/default/example/DropdownMenuCheckboxes.vue create mode 100644 apps/www/src/lib/registry/default/example/DropdownMenuRadioGroup.vue create mode 100644 apps/www/src/lib/registry/default/example/SelectScrollable.vue create mode 100644 apps/www/src/lib/registry/new-york/example/DropdownMenuCheckboxes.vue create mode 100644 apps/www/src/lib/registry/new-york/example/DropdownMenuRadioGroup.vue create mode 100644 apps/www/src/lib/registry/new-york/example/SelectScrollable.vue diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index ccac6553..ec79dd0f 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -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", diff --git a/apps/www/src/content/docs/components/dropdown-menu.md b/apps/www/src/content/docs/components/dropdown-menu.md index 503461e4..51e64a93 100644 --- a/apps/www/src/content/docs/components/dropdown-menu.md +++ b/apps/www/src/content/docs/components/dropdown-menu.md @@ -1,18 +1,17 @@ --- title: Dropdown Menu description: Displays a menu to the user — such as a set of actions or functions — triggered by a button. -source: apps/www/src/lib/registry/default/ui/dropdown-menu +source: apps/www/src/lib/registry/default/ui/dropdown-menu primitive: https://www.radix-vue.com/components/dropdown-menu.html --- - - + ## Installation ```bash npx shadcn-vue@latest add dropdown-menu -``` +``` ## Usage ```vue @@ -40,4 +39,14 @@ import { -``` \ No newline at end of file +``` + +## Examples + +### Checkboxes + + + +### Radio Group + + diff --git a/apps/www/src/content/docs/components/input.md b/apps/www/src/content/docs/components/input.md index ae55f1d9..ecb66a15 100644 --- a/apps/www/src/content/docs/components/input.md +++ b/apps/www/src/content/docs/components/input.md @@ -3,8 +3,7 @@ title: Input description: Displays a form input field or a component that looks like an input field. --- - - + ## Installation @@ -26,8 +25,6 @@ npx shadcn-vue@latest add input - - @@ -43,6 +40,8 @@ import { Input } from '@/components/ui/input' ``` +## Examples + ### Default diff --git a/apps/www/src/content/docs/components/select.md b/apps/www/src/content/docs/components/select.md index caae327d..ca6e1f53 100644 --- a/apps/www/src/content/docs/components/select.md +++ b/apps/www/src/content/docs/components/select.md @@ -1,16 +1,14 @@ --- title: Select description: Displays a list of options for the user to pick from—triggered by a button. -source: apps/www/src/lib/registry/default/ui/select +source: apps/www/src/lib/registry/default/ui/select primitive: https://www.radix-vue.com/components/select.html --- - - + ## Installation - ```bash npx shadcn-vue@latest add select ``` @@ -49,6 +47,10 @@ import { ## Examples +### Scrollable + + + ### Form diff --git a/apps/www/src/lib/registry/default/example/DropdownMenuCheckboxes.vue b/apps/www/src/lib/registry/default/example/DropdownMenuCheckboxes.vue new file mode 100644 index 00000000..e8ed233e --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DropdownMenuCheckboxes.vue @@ -0,0 +1,49 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/DropdownMenuRadioGroup.vue b/apps/www/src/lib/registry/default/example/DropdownMenuRadioGroup.vue new file mode 100644 index 00000000..77f23ce4 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DropdownMenuRadioGroup.vue @@ -0,0 +1,40 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/SelectScrollable.vue b/apps/www/src/lib/registry/default/example/SelectScrollable.vue new file mode 100644 index 00000000..e16e0b64 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/SelectScrollable.vue @@ -0,0 +1,117 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/DropdownMenuCheckboxes.vue b/apps/www/src/lib/registry/new-york/example/DropdownMenuCheckboxes.vue new file mode 100644 index 00000000..6b8cde6a --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/DropdownMenuCheckboxes.vue @@ -0,0 +1,49 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/DropdownMenuRadioGroup.vue b/apps/www/src/lib/registry/new-york/example/DropdownMenuRadioGroup.vue new file mode 100644 index 00000000..d0a8e768 --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/DropdownMenuRadioGroup.vue @@ -0,0 +1,40 @@ + + + diff --git a/apps/www/src/lib/registry/new-york/example/SelectScrollable.vue b/apps/www/src/lib/registry/new-york/example/SelectScrollable.vue new file mode 100644 index 00000000..50ff747b --- /dev/null +++ b/apps/www/src/lib/registry/new-york/example/SelectScrollable.vue @@ -0,0 +1,117 @@ + + +