-
-
Notifications
You must be signed in to change notification settings - Fork 644
Added Registry Directory #1664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Added Registry Directory #1664
Changes from all commits
8a214de
a277863
97d63e2
95ddfe9
5c99c38
d6cf03f
ca00668
ed9929c
de845d5
e202b4f
67c9779
c3a6324
ca4dd0b
6b0789e
4fac021
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <script setup lang="ts"> | ||
| import type { DirectoryRegistry } from "@/lib/directory-registry" | ||
| import { Button } from "@/registry/new-york-v4/ui/button" | ||
| import { | ||
| Dialog, | ||
| DialogClose, | ||
| DialogContent, | ||
| DialogDescription, | ||
| DialogFooter, | ||
| DialogHeader, | ||
| DialogTitle, | ||
| } from "@/registry/new-york-v4/ui/dialog" | ||
|
|
||
| interface Props { | ||
| open: boolean | ||
| registry: DirectoryRegistry | ||
| } | ||
|
|
||
| const props = defineProps<Props>() | ||
|
|
||
| const emit = defineEmits<{ | ||
| (e: "update:open", value: boolean): void | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <Dialog :open="open" @update:open="emit('update:open', $event)"> | ||
| <DialogContent class="dialog-ring animate-none! rounded-xl sm:max-w-md"> | ||
| <DialogHeader> | ||
| <DialogTitle>Add Registry</DialogTitle> | ||
| <DialogDescription> | ||
| Run this command to add {{ registry.name }} to your project. | ||
| </DialogDescription> | ||
| </DialogHeader> | ||
| <ProsePre | ||
| v-if="registry.command" | ||
| :code="registry?.command" | ||
| language="bash" | ||
| /> | ||
| <DialogFooter> | ||
| <DialogClose as-child> | ||
| <Button variant="outline"> | ||
| Cancel | ||
| </Button> | ||
| </DialogClose> | ||
| </DialogFooter> | ||
| </DialogContent> | ||
| </Dialog> | ||
| </template> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| <script setup lang="ts"> | ||
| import type { DirectoryRegistry } from "~/lib/directory-registry" | ||
| import { IconArrowUpRight } from "@tabler/icons-vue" | ||
| import { PlusIcon, Search, X } from "lucide-vue-next" | ||
| import { directoryRegistryList } from "~/lib/directory-registry" | ||
| import { Button } from "~/registry/new-york-v4/ui/button" | ||
| import { Field } from "~/registry/new-york-v4/ui/field" | ||
| import { | ||
| InputGroup, | ||
| InputGroupAddon, | ||
| InputGroupButton, | ||
| InputGroupInput, | ||
| } from "~/registry/new-york-v4/ui/input-group" | ||
| import { | ||
| Item, | ||
| ItemActions, | ||
| ItemContent, | ||
| ItemDescription, | ||
| ItemFooter, | ||
| ItemGroup, | ||
| ItemMedia, | ||
| ItemSeparator, | ||
| ItemTitle, | ||
| } from "~/registry/new-york-v4/ui/item" | ||
| import AddRegistryModal from "./AddRegistryModal.vue" | ||
|
|
||
| const searchQuery = ref("") | ||
| const addRegistryOpen = ref(false) | ||
| const selectedRegistry = ref<DirectoryRegistry | null>(null) | ||
|
|
||
| const registryList = computed(() => { | ||
| return directoryRegistryList.filter((r) => { | ||
| return r.name.includes(searchQuery.value) || r.description.includes(searchQuery.value) | ||
| }) | ||
| }) | ||
| function toggleAddRegistryModal(registry: DirectoryRegistry | null) { | ||
| selectedRegistry.value = registry | ||
| addRegistryOpen.value = !addRegistryOpen.value | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="mt-6"> | ||
| <Field> | ||
| <InputGroup> | ||
| <InputGroupAddon> | ||
| <Search /> | ||
| </InputGroupAddon> | ||
| <InputGroupInput v-model="searchQuery" placeholder="search" /> | ||
| <InputGroupAddon align="inline-end"> | ||
| <span class="text-muted-foreground tabular-nums sm:text-xs"> | ||
| {{ directoryRegistryList.length }} | ||
| {{ directoryRegistryList.length === 1 ? "Registry" : "Registries" }} | ||
| </span> | ||
| </InputGroupAddon> | ||
| <InputGroupAddon | ||
| align="inline-end" | ||
| :data-disabled="false" | ||
| class-name="data-[disabled=true]:hidden" | ||
| > | ||
| <InputGroupButton | ||
| aria-label="Clear" | ||
| title="Clear" | ||
| size="icon-xs" | ||
| > | ||
| <X /> | ||
| </InputGroupButton> | ||
| </inputgroupaddon> | ||
| </InputGroup> | ||
| </Field> | ||
| <ItemGroup> | ||
| <template v-for="registry in registryList" :key="registry.name"> | ||
| <Item class="group/item relative gap-6 px-0"> | ||
| <ItemMedia | ||
| variant="image" | ||
| class="*:[svg]:fill-foreground grayscale *:[svg]:size-8" | ||
| > | ||
| <span v-if="registry.logo.startsWith('<svg')" v-html="registry.logo" /> | ||
| <NuxtImg v-else :src="registry.logo" /> | ||
| </ItemMedia> | ||
| <ItemContent> | ||
| <ItemTitle> | ||
| <a | ||
| :href="registry.link" | ||
| rel="noopener noreferrer external" | ||
| class="group flex items-center gap-1" | ||
| target="_blank" | ||
| > | ||
| {{ registry.name }} | ||
| <IconArrowUpRight | ||
| class="size-4 opacity-0 group-hover:opacity-100" | ||
| /> | ||
| </a> | ||
| </ItemTitle> | ||
| <ItemDescription v-if="registry.description" class="text-pretty"> | ||
| {{ registry.description }} | ||
| </ItemDescription> | ||
| </ItemContent> | ||
| <ItemActions class=""> | ||
| <Button v-if="registry.command" variant="outline" @click.prevent="toggleAddRegistryModal(registry)"> | ||
| <PlusIcon /> | ||
| Add | ||
| </Button> | ||
| <Button as="a" :href="registry.link" target="_blank" size="sm" variant="outline"> | ||
| View <IconArrowUpRight /> | ||
| </Button> | ||
| </ItemActions> | ||
| <ItemFooter class="justify-start pl-16 sm:hidden"> | ||
| <Button as="a" :href="registry.link" target="_blank" size="sm" variant="outline"> | ||
| View <IconArrowUpRight /> | ||
| </Button> | ||
| </ItemFooter> | ||
| </Item> | ||
| <ItemSeparator /> | ||
| </template> | ||
| </ItemGroup> | ||
| <AddRegistryModal v-if="selectedRegistry" :open="addRegistryOpen" :registry="selectedRegistry" @update:open="toggleAddRegistryModal(null)" /> | ||
| </div> | ||
| </template> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| title: Registry Directory | ||
| description: Discover community registries for shadcn/ui components and blocks. | ||
| --- | ||
|
|
||
| These registries are built into the CLI with no additional configuration required. To add a component, run: | ||
|
|
||
| ```bash | ||
| npx shadcn-vue add @<registry>/<component>. | ||
| ``` | ||
|
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the trailing period in the CLI example. Copy/pasting the command as-is will include the period and fail. π§ Proposed fix-npx shadcn-vue add @<registry>/<component>.
+npx shadcn-vue add @<registry>/<component>π€ Prompt for AI Agents |
||
|
|
||
| <Callout variant="warning" icon class="gap-2! border-amber-200 bg-amber-50 p-2 font-semibold dark:border-amber-900 dark:bg-amber-950 *:[svg]:translate-y-1"> | ||
| Community registries are maintained by third-party developers and are not officially curated. Always review code on installation to ensure it meets your security and quality standards. | ||
|
|
||
| </Callout> | ||
|
|
||
| Don't see a registry? [Learn how to add it here.](/docs/registry) | ||
|
|
||
| <RegistryList /> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export interface DirectoryRegistry { | ||
| name: string | ||
| description: string | ||
| link: string | ||
| command?: string | ||
| logo: string | ||
| } | ||
| import directoryJson from '@/registry/directory.json' | ||
|
|
||
| export const directoryRegistryList: DirectoryRegistry[] = [...directoryJson] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name": "Insipira UI", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Inspira UI is a collection of reusable, animated components powered by TailwindCSS , motion-v , GSAP & threejs β crafted to help you ship faster and better.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "link": "https://inspira-ui.com/docs/en", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "logo": "https://cdn.inspira-ui.com/logo-dark.svg" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name": "Stunning UI", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Create Stunning Websites That Stand Out", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "link": "https://www.stunningui.com/", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "logo": "https://robertshaw.id/assets/stunning-ui.svg" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name": "Mapcn", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Beautiful maps,made simple.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "link": "https://mapcn-vue.geoql.in/", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix user-facing typos in registry data. The name/description mismatch and missing space will show up in UI. π§ Proposed fix- "name": "Insipira UI",
+ "name": "Inspira UI",
@@
- "description": "Beautiful maps,made simple.",
+ "description": "Beautiful maps, made simple.",π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "logo": "https://raw.githubusercontent.com/geoql/v-maplibre/refs/heads/main/apps/mapcn-vue/public/favicon.svg", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "command": "npx shadcn-vue@latest add https://mapcn-vue.geoql.in/r/map" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clear button is non-functional and has inconsistent tag casing.
Two issues here:
@clickhandler to actually clear the search query.</inputgroupaddon>uses lowercase while the opening tag uses PascalCase.π Proposed fix
<InputGroupButton aria-label="Clear" title="Clear" size="icon-xs" + `@click`="searchQuery = ''" > <X /> </InputGroupButton> - </inputgroupaddon> + </InputGroupAddon>π Committable suggestion
π€ Prompt for AI Agents