diff --git a/apps/www/.vitepress/theme/components/ComponentPreview.vue b/apps/www/.vitepress/theme/components/ComponentPreview.vue index 2ff0ea80..194b7608 100644 --- a/apps/www/.vitepress/theme/components/ComponentPreview.vue +++ b/apps/www/.vitepress/theme/components/ComponentPreview.vue @@ -1,8 +1,8 @@ + + diff --git a/apps/www/.vitepress/theme/layout/DocsLayout.vue b/apps/www/.vitepress/theme/layout/DocsLayout.vue index 30117124..4b21cf3f 100644 --- a/apps/www/.vitepress/theme/layout/DocsLayout.vue +++ b/apps/www/.vitepress/theme/layout/DocsLayout.vue @@ -4,6 +4,7 @@ import { docsConfig } from '../config/docs' import TableOfContentVue from '../components/TableOfContent.vue' import { ScrollArea } from '@/lib/registry/default/ui/scroll-area' import RadixIconsCode from '~icons/radix-icons/code' +import ChevronRightIcon from '~icons/lucide/chevron-right' const $route = useRoute() const { frontmatter } = useData() @@ -47,6 +48,16 @@ const { frontmatter } = useData()
+
+
+ Docs +
+ +
+ {{ frontmatter.title }} +
+
+

{{ frontmatter.title }} diff --git a/apps/www/src/content/docs/components/alert.md b/apps/www/src/content/docs/components/alert.md new file mode 100644 index 00000000..c8a64ee6 --- /dev/null +++ b/apps/www/src/content/docs/components/alert.md @@ -0,0 +1,47 @@ +--- +title: Alert +description: Displays a callout for user attention. +--- + + + + +<<< ../../../lib/registry/default/examples/AlertDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add alert +``` + + + +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/aspect-ratio.md b/apps/www/src/content/docs/components/aspect-ratio.md new file mode 100644 index 00000000..1ca56e89 --- /dev/null +++ b/apps/www/src/content/docs/components/aspect-ratio.md @@ -0,0 +1,48 @@ +--- +title: Aspect Ratio +description: Displays content within a desired ratio. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/aspect-ratio +primitive: https://www.radix-vue.com/components/aspect-ratio.html +--- + + + + +<<< ../../../lib/registry/default/examples/AspectRatioDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add aspect-ratio +``` + + + +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/avatar.md b/apps/www/src/content/docs/components/avatar.md new file mode 100644 index 00000000..e04305bb --- /dev/null +++ b/apps/www/src/content/docs/components/avatar.md @@ -0,0 +1,47 @@ +--- +title: Avatar +description: An image element with a fallback for representing the user. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/avatar +primitive: https://www.radix-vue.com/components/avatar.html +--- + + + + +<<< ../../../lib/registry/default/examples/AvatarDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add avatar +``` + + + +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/lib/registry/default/examples/AlertDemo.vue b/apps/www/src/lib/registry/default/examples/AlertDemo.vue new file mode 100644 index 00000000..b4023088 --- /dev/null +++ b/apps/www/src/lib/registry/default/examples/AlertDemo.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/www/src/lib/registry/default/examples/AspectRatioDemo.vue b/apps/www/src/lib/registry/default/examples/AspectRatioDemo.vue new file mode 100644 index 00000000..8e272bc4 --- /dev/null +++ b/apps/www/src/lib/registry/default/examples/AspectRatioDemo.vue @@ -0,0 +1,13 @@ + + + diff --git a/apps/www/src/lib/registry/default/examples/AvatarDemo.vue b/apps/www/src/lib/registry/default/examples/AvatarDemo.vue new file mode 100644 index 00000000..ca53315d --- /dev/null +++ b/apps/www/src/lib/registry/default/examples/AvatarDemo.vue @@ -0,0 +1,10 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/alert/Alert.vue b/apps/www/src/lib/registry/default/ui/alert/Alert.vue index 641e150d..b95d5c89 100644 --- a/apps/www/src/lib/registry/default/ui/alert/Alert.vue +++ b/apps/www/src/lib/registry/default/ui/alert/Alert.vue @@ -1,78 +1,17 @@ diff --git a/apps/www/src/lib/registry/default/ui/alert/AlertDescription.vue b/apps/www/src/lib/registry/default/ui/alert/AlertDescription.vue index fe3f9670..a539b631 100644 --- a/apps/www/src/lib/registry/default/ui/alert/AlertDescription.vue +++ b/apps/www/src/lib/registry/default/ui/alert/AlertDescription.vue @@ -7,7 +7,7 @@ const props = defineProps({ diff --git a/apps/www/src/lib/registry/default/ui/alert/AlertTitle.vue b/apps/www/src/lib/registry/default/ui/alert/AlertTitle.vue index 9821e45c..c5dd22c2 100644 --- a/apps/www/src/lib/registry/default/ui/alert/AlertTitle.vue +++ b/apps/www/src/lib/registry/default/ui/alert/AlertTitle.vue @@ -1,5 +1,9 @@ + + diff --git a/apps/www/src/lib/registry/default/ui/alert/index.ts b/apps/www/src/lib/registry/default/ui/alert/index.ts index 2b4f31b2..5ca03a7f 100644 --- a/apps/www/src/lib/registry/default/ui/alert/index.ts +++ b/apps/www/src/lib/registry/default/ui/alert/index.ts @@ -1,3 +1,21 @@ +import { cva } from 'class-variance-authority' + export { default as Alert } from './Alert.vue' export { default as AlertTitle } from './AlertTitle.vue' export { default as AlertDescription } from './AlertDescription.vue' + +export const alertVariants = cva( + 'relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground', + { + variants: { + variant: { + default: 'bg-background text-foreground', + destructive: + 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive', + }, + }, + defaultVariants: { + variant: 'default', + }, + }, +) diff --git a/apps/www/src/lib/registry/default/ui/avatar/Avatar.vue b/apps/www/src/lib/registry/default/ui/avatar/Avatar.vue index f3b10881..39f71b65 100644 --- a/apps/www/src/lib/registry/default/ui/avatar/Avatar.vue +++ b/apps/www/src/lib/registry/default/ui/avatar/Avatar.vue @@ -1,46 +1,22 @@ diff --git a/apps/www/src/lib/registry/default/ui/avatar/index.ts b/apps/www/src/lib/registry/default/ui/avatar/index.ts index 49741211..a4346095 100644 --- a/apps/www/src/lib/registry/default/ui/avatar/index.ts +++ b/apps/www/src/lib/registry/default/ui/avatar/index.ts @@ -1,3 +1,22 @@ +import { cva } from 'class-variance-authority' + export { default as Avatar } from './Avatar.vue' export { default as AvatarImage } from './AvatarImage.vue' export { default as AvatarFallback } from './AvatarFallback.vue' + +export const avatarVariant = cva( + 'inline-flex items-center justify-center font-normal text-foregorund select-none shrink-0 bg-secondary overflow-hidden', + { + variants: { + size: { + sm: 'h-10 w-10 text-xs', + base: 'h-16 w-16 text-2xl', + lg: 'h-32 w-32 text-5xl', + }, + shape: { + circle: 'rounded-full', + square: 'rounded-md', + }, + }, + }, +)