From bb7663330f2f14be1f167e89e5245363a1ead642 Mon Sep 17 00:00:00 2001 From: zernonia Date: Sun, 3 Sep 2023 01:38:53 +0800 Subject: [PATCH] feat: add docs for components --- apps/www/.vitepress/theme/styles/vp-doc.css | 4 +- .../src/content/docs/components/hover-card.md | 53 ++++++++ apps/www/src/content/docs/components/input.md | 42 ++++++ apps/www/src/content/docs/components/label.md | 43 ++++++ .../src/content/docs/components/menubar.md | 65 +++++++++ .../src/content/docs/components/progress.md | 43 ++++++ .../content/docs/components/radio-group.md | 53 ++++++++ .../content/docs/components/scroll-area.md | 50 +++++++ .../src/content/docs/components/separator.md | 43 ++++++ apps/www/src/content/docs/components/sheet.md | 61 +++++++++ .../src/content/docs/components/skeleton.md | 41 ++++++ .../www/src/content/docs/components/slider.md | 45 +++++++ .../www/src/content/docs/components/switch.md | 43 ++++++ apps/www/src/content/docs/components/table.md | 75 +++++++++++ apps/www/src/content/docs/components/tabs.md | 58 +++++++++ .../src/content/docs/components/textarea.md | 41 ++++++ .../www/src/content/docs/components/toggle.md | 43 ++++++ .../src/content/docs/components/tooltip.md | 55 ++++++++ .../default/examples/HoverCardDemo.vue | 47 +++++++ .../registry/default/examples/InputDemo.vue | 7 + .../registry/default/examples/LabelDemo.vue | 13 ++ .../registry/default/examples/MenubarDemo.vue | 123 ++++++++++++++++++ .../default/examples/ProgressDemo.vue | 15 +++ .../default/examples/RadioGroupDemo.vue | 21 +++ .../default/examples/ScrollAreaDemo.vue | 25 ++++ .../default/examples/SeparatorDemo.vue | 24 ++++ .../registry/default/examples/SheetDemo.vue | 54 ++++++++ .../default/examples/SkeletonDemo.vue | 13 ++ .../registry/default/examples/SliderDemo.vue | 15 +++ .../registry/default/examples/SwitchDemo.vue | 11 ++ .../registry/default/examples/TableDemo.vue | 86 ++++++++++++ .../registry/default/examples/TabsDemo.vue | 78 +++++++++++ .../default/examples/TextareaDemo.vue | 7 + .../registry/default/examples/ToggleDemo.vue | 11 ++ .../registry/default/examples/TooltipDemo.vue | 24 ++++ .../ui/menubar/MenubarCheckboxItem.vue | 6 +- .../default/ui/menubar/MenubarContent.vue | 4 +- .../default/ui/menubar/MenubarItem.vue | 5 +- .../default/ui/menubar/MenubarLabel.vue | 10 +- .../default/ui/menubar/MenubarRadioItem.vue | 11 +- .../default/ui/menubar/MenubarSeparator.vue | 3 +- .../default/ui/menubar/MenubarShortcut.vue | 8 +- .../default/ui/menubar/MenubarSubContent.vue | 2 +- .../default/ui/menubar/MenubarSubTrigger.vue | 5 +- .../default/ui/menubar/MenubarTrigger.vue | 2 +- .../lib/registry/default/ui/slider/Slider.vue | 69 +++------- .../lib/registry/default/ui/switch/Switch.vue | 5 +- .../lib/registry/default/ui/table/Table.vue | 8 +- .../registry/default/ui/table/TableBody.vue | 8 +- .../default/ui/table/TableCaption.vue | 8 +- .../registry/default/ui/table/TableCell.vue | 6 +- .../registry/default/ui/table/TableFooter.vue | 11 ++ .../registry/default/ui/table/TableHead.vue | 13 +- .../registry/default/ui/table/TableHeader.vue | 6 +- .../registry/default/ui/table/TableRow.vue | 6 +- .../registry/default/ui/tabs/TabsContent.vue | 2 +- .../lib/registry/default/ui/tabs/TabsList.vue | 2 +- .../registry/default/ui/textarea/Input.vue | 68 ---------- .../registry/default/ui/textarea/Textarea.vue | 62 +-------- .../registry/default/ui/tooltip/Tooltip.vue | 13 ++ .../default/ui/tooltip/TooltipContent.vue | 15 +++ .../default/ui/tooltip/TooltipProvider.vue | 11 ++ .../default/ui/tooltip/TooltipTrigger.vue | 11 ++ .../lib/registry/default/ui/tooltip/index.ts | 4 + 64 files changed, 1572 insertions(+), 244 deletions(-) create mode 100644 apps/www/src/content/docs/components/hover-card.md create mode 100644 apps/www/src/content/docs/components/input.md create mode 100644 apps/www/src/content/docs/components/label.md create mode 100644 apps/www/src/content/docs/components/menubar.md create mode 100644 apps/www/src/content/docs/components/progress.md create mode 100644 apps/www/src/content/docs/components/radio-group.md create mode 100644 apps/www/src/content/docs/components/scroll-area.md create mode 100644 apps/www/src/content/docs/components/separator.md create mode 100644 apps/www/src/content/docs/components/sheet.md create mode 100644 apps/www/src/content/docs/components/skeleton.md create mode 100644 apps/www/src/content/docs/components/slider.md create mode 100644 apps/www/src/content/docs/components/switch.md create mode 100644 apps/www/src/content/docs/components/table.md create mode 100644 apps/www/src/content/docs/components/tabs.md create mode 100644 apps/www/src/content/docs/components/textarea.md create mode 100644 apps/www/src/content/docs/components/toggle.md create mode 100644 apps/www/src/content/docs/components/tooltip.md create mode 100644 apps/www/src/lib/registry/default/examples/HoverCardDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/InputDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/LabelDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/MenubarDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/ProgressDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/RadioGroupDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/ScrollAreaDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/SeparatorDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/SheetDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/SkeletonDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/SliderDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/SwitchDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/TableDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/TabsDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/TextareaDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/ToggleDemo.vue create mode 100644 apps/www/src/lib/registry/default/examples/TooltipDemo.vue create mode 100644 apps/www/src/lib/registry/default/ui/table/TableFooter.vue delete mode 100644 apps/www/src/lib/registry/default/ui/textarea/Input.vue create mode 100644 apps/www/src/lib/registry/default/ui/tooltip/Tooltip.vue create mode 100644 apps/www/src/lib/registry/default/ui/tooltip/TooltipContent.vue create mode 100644 apps/www/src/lib/registry/default/ui/tooltip/TooltipProvider.vue create mode 100644 apps/www/src/lib/registry/default/ui/tooltip/TooltipTrigger.vue create mode 100644 apps/www/src/lib/registry/default/ui/tooltip/index.ts diff --git a/apps/www/.vitepress/theme/styles/vp-doc.css b/apps/www/.vitepress/theme/styles/vp-doc.css index e38d6893..fe34f209 100644 --- a/apps/www/.vitepress/theme/styles/vp-doc.css +++ b/apps/www/.vitepress/theme/styles/vp-doc.css @@ -165,7 +165,7 @@ * Table * -------------------------------------------------------------------------- */ -.vp-doc table { +/* .vp-doc table { display: block; border-collapse: collapse; margin: 20px 0; @@ -197,7 +197,7 @@ .vp-doc td { font-size: 14px; -} +} */ /** * Decorational elements diff --git a/apps/www/src/content/docs/components/hover-card.md b/apps/www/src/content/docs/components/hover-card.md new file mode 100644 index 00000000..9075bd82 --- /dev/null +++ b/apps/www/src/content/docs/components/hover-card.md @@ -0,0 +1,53 @@ +--- +title: Hover Card +description: For sighted users to preview content available behind a link. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/hover-card +primitive: https://www.radix-vue.com/components/hover-card.html +--- + + + + +<<< ../../../lib/registry/default/examples/HoverCardDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add hover-card +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/input.md b/apps/www/src/content/docs/components/input.md new file mode 100644 index 00000000..dc597469 --- /dev/null +++ b/apps/www/src/content/docs/components/input.md @@ -0,0 +1,42 @@ +--- +title: Input +description: Displays a form input field or a component that looks like an input field. +--- + + + + +<<< ../../../lib/registry/default/examples/InputDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add input +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/label.md b/apps/www/src/content/docs/components/label.md new file mode 100644 index 00000000..8863f929 --- /dev/null +++ b/apps/www/src/content/docs/components/label.md @@ -0,0 +1,43 @@ +--- +title: Label +description: Renders an accessible label associated with controls. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/label +primitive: https://www.radix-vue.com/components/label.html +--- + + + +<<< ../../../lib/registry/default/examples/LabelDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add input +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/menubar.md b/apps/www/src/content/docs/components/menubar.md new file mode 100644 index 00000000..82fe73af --- /dev/null +++ b/apps/www/src/content/docs/components/menubar.md @@ -0,0 +1,65 @@ +--- +title: Menubar +description: A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/menubar +primitive: https://www.radix-vue.com/components/menubar.html +--- + + + +<<< ../../../lib/registry/default/examples/MenubarDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add menubar +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/progress.md b/apps/www/src/content/docs/components/progress.md new file mode 100644 index 00000000..5e144745 --- /dev/null +++ b/apps/www/src/content/docs/components/progress.md @@ -0,0 +1,43 @@ +--- +title: Progress +description: Displays an indicator showing the completion progress of a task, typically displayed as a progress bar. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/progress +primitive: https://www.radix-vue.com/components/progress.html +--- + + + +<<< ../../../lib/registry/default/examples/ProgressDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add progress +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/radio-group.md b/apps/www/src/content/docs/components/radio-group.md new file mode 100644 index 00000000..dd7bafb0 --- /dev/null +++ b/apps/www/src/content/docs/components/radio-group.md @@ -0,0 +1,53 @@ +--- +title: Radio Group +description: A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/radio-group +primitive: https://www.radix-vue.com/components/radio-group.html +--- + + + +<<< ../../../lib/registry/default/examples/RadioGroupDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add radio-group +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/scroll-area.md b/apps/www/src/content/docs/components/scroll-area.md new file mode 100644 index 00000000..dc0f0106 --- /dev/null +++ b/apps/www/src/content/docs/components/scroll-area.md @@ -0,0 +1,50 @@ +--- +title: Scroll-area +description: Augments native scroll functionality for custom, cross-browser styling. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/scroll-area +primitive: https://www.radix-vue.com/components/scroll-area.html +--- + + + +<<< ../../../lib/registry/default/examples/ScrollAreaDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add scroll-area +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/separator.md b/apps/www/src/content/docs/components/separator.md new file mode 100644 index 00000000..f63b186c --- /dev/null +++ b/apps/www/src/content/docs/components/separator.md @@ -0,0 +1,43 @@ +--- +title: Separator +description: Visually or semantically separates content. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/separator +primitive: https://www.radix-vue.com/components/separator.html +--- + + + +<<< ../../../lib/registry/default/examples/SeparatorDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add separator +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/sheet.md b/apps/www/src/content/docs/components/sheet.md new file mode 100644 index 00000000..e6073a84 --- /dev/null +++ b/apps/www/src/content/docs/components/sheet.md @@ -0,0 +1,61 @@ +--- +title: Sheet +description: Extends the Dialog component to display content that complements the main content of the screen. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/dialog +primitive: https://www.radix-vue.com/components/dialog.html +--- + + + +<<< ../../../lib/registry/default/examples/SheetDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add sheet +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/skeleton.md b/apps/www/src/content/docs/components/skeleton.md new file mode 100644 index 00000000..cae5d4fc --- /dev/null +++ b/apps/www/src/content/docs/components/skeleton.md @@ -0,0 +1,41 @@ +--- +title: Skeleton +description: Use to show a placeholder while content is loading. +--- + + + +<<< ../../../lib/registry/default/examples/SkeletonDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add skeleton +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/slider.md b/apps/www/src/content/docs/components/slider.md new file mode 100644 index 00000000..e8f2e50a --- /dev/null +++ b/apps/www/src/content/docs/components/slider.md @@ -0,0 +1,45 @@ +--- +title: Slider +description: An input where the user selects a value from within a given range. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/slider +primitive: https://www.radix-vue.com/components/slider.html +--- + + + +<<< ../../../lib/registry/default/examples/SliderDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add slider +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/switch.md b/apps/www/src/content/docs/components/switch.md new file mode 100644 index 00000000..19bceb27 --- /dev/null +++ b/apps/www/src/content/docs/components/switch.md @@ -0,0 +1,43 @@ +--- +title: Switch +description: A control that allows the user to toggle between checked and not checked. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/switch +primitive: https://www.radix-vue.com/components/switch.html +--- + + + +<<< ../../../lib/registry/default/examples/SwitchDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add switch +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/table.md b/apps/www/src/content/docs/components/table.md new file mode 100644 index 00000000..136ea3fe --- /dev/null +++ b/apps/www/src/content/docs/components/table.md @@ -0,0 +1,75 @@ +--- +title: Table +description: A responsive table component. +--- + + + +<<< ../../../lib/registry/default/examples/TableDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add table +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/tabs.md b/apps/www/src/content/docs/components/tabs.md new file mode 100644 index 00000000..ba4da2f2 --- /dev/null +++ b/apps/www/src/content/docs/components/tabs.md @@ -0,0 +1,58 @@ +--- +title: Tabs +description: A set of layered sections of content—known as tab panels—that are displayed one at a time. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/tabs +primitive: https://www.radix-vue.com/components/tabs.html +--- + + + +<<< ../../../lib/registry/default/examples/TabsDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add tabs +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + +``` \ No newline at end of file diff --git a/apps/www/src/content/docs/components/textarea.md b/apps/www/src/content/docs/components/textarea.md new file mode 100644 index 00000000..5ba71ca1 --- /dev/null +++ b/apps/www/src/content/docs/components/textarea.md @@ -0,0 +1,41 @@ +--- +title: Textarea +description: Displays a form textarea or a component that looks like a textarea. +--- + + + +<<< ../../../lib/registry/default/examples/TextareaDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add textarea +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + +