Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions packages/components/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"files": [
{
"path": "src/core/accordion/accordion.tsx",
"target": "components/ui/accordion.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -109,6 +110,7 @@
"files": [
{
"path": "src/core/badge/badge.tsx",
"target": "components/ui/badge.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -200,6 +202,7 @@
"files": [
{
"path": "src/core/breadcrumbs/breadcrumbs.tsx",
"target": "components/ui/breadcrumbs.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -291,6 +294,7 @@
"files": [
{
"path": "src/core/button/button.tsx",
"target": "components/ui/button.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -383,6 +387,7 @@
"files": [
{
"path": "src/core/calendar/calendar.tsx",
"target": "components/ui/calendar.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -476,6 +481,7 @@
"files": [
{
"path": "src/core/card/card.tsx",
"target": "components/ui/card.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -569,6 +575,7 @@
"files": [
{
"path": "src/core/checkbox/checkbox.tsx",
"target": "components/ui/checkbox.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -661,6 +668,7 @@
"files": [
{
"path": "src/core/combobox/combobox.tsx",
"target": "components/ui/combobox.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -754,6 +762,7 @@
"files": [
{
"path": "src/core/command/command.tsx",
"target": "components/ui/command.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -848,6 +857,7 @@
"files": [
{
"path": "src/core/date-field/date-field.tsx",
"target": "components/ui/date-field.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -941,6 +951,7 @@
"files": [
{
"path": "src/core/date-picker/date-picker.tsx",
"target": "components/ui/date-picker.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1037,6 +1048,7 @@
"files": [
{
"path": "src/core/input/input.tsx",
"target": "components/ui/input.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1129,6 +1141,7 @@
"files": [
{
"path": "src/core/menu/menu.tsx",
"target": "components/ui/menu.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1221,6 +1234,7 @@
"files": [
{
"path": "src/core/meter/meter.tsx",
"target": "components/ui/meter.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1313,6 +1327,7 @@
"files": [
{
"path": "src/core/modal/modal.tsx",
"target": "components/ui/modal.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1404,6 +1419,7 @@
"files": [
{
"path": "src/core/popover/popover.tsx",
"target": "components/ui/popover.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1496,6 +1512,7 @@
"files": [
{
"path": "src/core/radio-group/radio-group.tsx",
"target": "components/ui/radio-group.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1589,6 +1606,7 @@
"files": [
{
"path": "src/core/select/select.tsx",
"target": "components/ui/select.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1682,6 +1700,7 @@
"files": [
{
"path": "src/core/slider/slider.tsx",
"target": "components/ui/slider.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1775,6 +1794,7 @@
"files": [
{
"path": "src/core/switch/switch.tsx",
"target": "components/ui/switch.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1868,6 +1888,7 @@
"files": [
{
"path": "src/core/table/table.tsx",
"target": "components/ui/table.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -1964,6 +1985,7 @@
"files": [
{
"path": "src/core/tabs/tabs.tsx",
"target": "components/ui/tabs.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -2057,6 +2079,7 @@
"files": [
{
"path": "src/core/tag-group/tag-group.tsx",
"target": "components/ui/tag-group.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -2151,6 +2174,7 @@
"files": [
{
"path": "src/core/time-field/time-field.tsx",
"target": "components/ui/time-field.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -2244,6 +2268,7 @@
"files": [
{
"path": "src/core/toggle/toggle.tsx",
"target": "components/ui/toggle.tsx",
"type": "registry:component"
}
],
Expand Down Expand Up @@ -2337,6 +2362,7 @@
"files": [
{
"path": "src/core/tooltip/tooltip.tsx",
"target": "components/ui/tooltip.tsx",
"type": "registry:component"
}
],
Expand Down
1 change: 1 addition & 0 deletions packages/components/scripts/gen-registry-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async function processComponent(
files: [
{
path: `src/core/${componentId}/${componentId}.tsx`,
target: `components/ui/${componentId}.tsx`,
type: "registry:component",
},
],
Expand Down
4 changes: 2 additions & 2 deletions web/app/llms.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface RegistryItem {

export async function GET() {
// Read the shadcn registry
const registryPath = join(process.cwd(), "public/r/index.json");
const registryPath = join(process.cwd(), "public/r/registry.json");
const registry = JSON.parse(readFileSync(registryPath, "utf8"));
const components = registry.items;

Expand Down Expand Up @@ -138,7 +138,7 @@ This returns the complete component definition with source code in the \`files[]

## Registry Endpoints

- \`GET /r/index.json\` - List all components with metadata
- \`GET /r/registry.json\` - List all components with metadata
- \`GET /r/{component}.json\` - Get specific component with full source code

## Additional Resources
Expand Down
45 changes: 0 additions & 45 deletions web/app/r/[...segments]/route.ts

This file was deleted.

2 changes: 1 addition & 1 deletion web/app/r/[[...segments]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function GET(

// If no segments, return the registry index
if (!segments || segments.length === 0) {
const registryPath = join(process.cwd(), "public/r/index.json");
const registryPath = join(process.cwd(), "public/r/registry.json");
const registryContent = readFileSync(registryPath, "utf8");
return new NextResponse(registryContent, {
headers: {
Expand Down
2 changes: 1 addition & 1 deletion web/components/component-metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function ComponentMetadata({
showTags = false,
}: ComponentMetadataProps) {
// Read from shadcn registry for metadata
const shadcnRegistryPath = join(process.cwd(), "public/r/index.json");
const shadcnRegistryPath = join(process.cwd(), "public/r/registry.json");
const shadcnRegistryContent = readFileSync(shadcnRegistryPath, "utf8");
const shadcnRegistry = JSON.parse(shadcnRegistryContent);

Expand Down
2 changes: 1 addition & 1 deletion web/lib/component-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const examplesDir = join(process.cwd(), "../packages/components/src/examples");
export async function getComponentSource(name: string): Promise<string> {
try {
// Read the shadcn registry
const shadcnRegistryPath = join(process.cwd(), "public/r/index.json");
const shadcnRegistryPath = join(process.cwd(), "public/r/registry.json");
const shadcnRegistryContent = readFileSync(shadcnRegistryPath, "utf8");
const shadcnRegistry = JSON.parse(shadcnRegistryContent);

Expand Down
3 changes: 2 additions & 1 deletion web/public/r/accordion.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"path": "src/core/accordion/accordion.tsx",
"content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\n\nimport {\n\tButton,\n\tDisclosure,\n\tDisclosureGroup,\n\ttype DisclosureGroupProps,\n\tDisclosurePanel,\n\ttype DisclosureProps,\n\tHeading,\n} from \"react-aria-components\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { Minus, Plus } from \"lucide-react\";\n\nconst accordion = tv({\n\tslots: {\n\t\troot: \"group w-full\",\n\t\tgroup: \"flex flex-col gap-3\",\n\t\tbutton:\n\t\t\t\"flex w-full items-center justify-between gap-6 rounded-2xl border border-border bg-surface-2 p-4 data-[focus-visible]:outline-none data-[focus-visible]:ring-2 data-[focus-visible]:ring-focus data-[focus-visible]:ring-offset-2 data-[focus-visible]:ring-offset-surface group-data-[expanded]:rounded-b-none group-data-[expanded]:border-b-0\",\n\t\ticon: \"size-4 shrink-0 fill-none transition-transform duration-200\",\n\t\tpanel:\n\t\t\t\"rounded-b-2xl border-border bg-surface-2 px-4 text-muted-foreground text-sm group-data-[expanded]:border-x group-data-[expanded]:border-b group-data-[expanded]:pb-4\",\n\t},\n});\n\nconst styles = accordion();\n\ntype AccordionVariantProps = VariantProps<typeof accordion>;\n\ninterface AccordionProps\n\textends AccordionVariantProps,\n\t\tOmit<DisclosureProps, \"children\"> {\n\tclassName?: string;\n\ttitle?: string;\n\tchildren?: ReactNode;\n}\n\nconst Accordion = ({\n\tclassName,\n\ttitle,\n\tchildren,\n\t...props\n}: AccordionProps) => {\n\treturn (\n\t\t<Disclosure className={styles.root({ className })} {...props}>\n\t\t\t{({ isExpanded }) => (\n\t\t\t\t<>\n\t\t\t\t\t<Heading>\n\t\t\t\t\t\t<Button slot=\"trigger\" className={styles.button()}>\n\t\t\t\t\t\t\t<span className=\"font-bold\">{title}</span>\n\t\t\t\t\t\t\t{isExpanded ? (\n\t\t\t\t\t\t\t\t<Minus className={styles.icon()} />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Plus className={styles.icon()} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Heading>\n\t\t\t\t\t<DisclosurePanel className={styles.panel()}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</DisclosurePanel>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</Disclosure>\n\t);\n};\n\ninterface AccordionGroupProps extends DisclosureGroupProps {\n\tclassName?: string;\n\tchildren: ReactNode;\n}\n\nconst AccordionGroup = ({\n\tclassName,\n\tchildren,\n\t...props\n}: AccordionGroupProps) => (\n\t<DisclosureGroup {...props} className={styles.group({ className })}>\n\t\t{children}\n\t</DisclosureGroup>\n);\n\nexport { Accordion, AccordionGroup };\nexport type { AccordionProps, AccordionGroupProps };\n",
"type": "registry:component"
"type": "registry:component",
"target": "components/ui/accordion.tsx"
}
],
"tailwind": {
Expand Down
3 changes: 2 additions & 1 deletion web/public/r/badge.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"path": "src/core/badge/badge.tsx",
"content": "import type { HTMLAttributes } from \"react\";\n\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const badge = tv({\n\tbase: \"flex items-center justify-center rounded-4xl px-3 py-2 font-semibold text-xs\",\n\tvariants: {\n\t\tvariant: {\n\t\t\tattention: \"bg-gradient-to-r from-pink-500 to-purple-500 text-white\",\n\t\t\tneutral: \"bg-secondary text-secondary-fg\",\n\t\t\tdanger: \"bg-danger text-danger-fg\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"attention\",\n\t},\n});\n\ntype BadgeProps = VariantProps<typeof badge> & HTMLAttributes<HTMLSpanElement>;\n\nconst Badge = ({ className, variant, ...props }: BadgeProps) => (\n\t<span className={badge({ variant, className })} {...props} />\n);\n\nexport { Badge };\nexport type { BadgeProps };\n",
"type": "registry:component"
"type": "registry:component",
"target": "components/ui/badge.tsx"
}
],
"tailwind": {
Expand Down
3 changes: 2 additions & 1 deletion web/public/r/breadcrumbs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"path": "src/core/breadcrumbs/breadcrumbs.tsx",
"content": "\"use client\";\n\nimport {\n\tBreadcrumbs as AriaBreadcrumbs,\n\ttype BreadcrumbsProps as AriaBreadcrumbsProps,\n\tBreadcrumb,\n\ttype BreadcrumbProps,\n\tLink,\n\ttype LinkProps,\n} from \"react-aria-components\";\nimport { tv } from \"tailwind-variants\";\n\nconst breadcrumbs = tv({\n\tslots: {\n\t\troot: \"m-0 flex list-none items-center gap-2 p-0 font-md\",\n\t\tlink: \"relative cursor-pointer rounded-md text-fg outline-none ring-focus data-[hovered]:underline data-[focus-visible]:ring-2 [&[aria-current]]:font-extrabold [&[aria-current]]:text-fg\",\n\t\titem: \"flex items-center gap-2\",\n\t},\n});\n\nconst styles = breadcrumbs();\n\nconst Breadcrumbs = <T extends object>({\n\tchildren,\n\tclassName,\n\t...props\n}: AriaBreadcrumbsProps<T> & { className?: string }) => (\n\t<AriaBreadcrumbs className={styles.root({ className })} {...props}>\n\t\t{children}\n\t</AriaBreadcrumbs>\n);\n\nconst BreadcrumbsLink = ({\n\tchildren,\n\tclassName,\n\t...props\n}: LinkProps & { className?: string }) => (\n\t<Link className={styles.link({ className })} {...props}>\n\t\t{children}\n\t</Link>\n);\n\nconst BreadcrumbsItem = ({\n\tchildren,\n\tclassName,\n\t...props\n}: BreadcrumbProps & { className?: string }) => (\n\t<Breadcrumb className={styles.item({ className })} {...props}>\n\t\t{children}\n\t</Breadcrumb>\n);\n\nexport { BreadcrumbsItem, BreadcrumbsLink, Breadcrumbs };",
"type": "registry:component"
"type": "registry:component",
"target": "components/ui/breadcrumbs.tsx"
}
],
"tailwind": {
Expand Down
3 changes: 2 additions & 1 deletion web/public/r/button.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"path": "src/core/button/button.tsx",
"content": "\"use client\";\n\nimport {\n\tButton as AriaButton,\n\ttype ButtonProps as AriaButtonProps,\n} from \"react-aria-components\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nconst button = tv({\n\tbase: \"inline-flex appearance-none items-center justify-center rounded-full font-semibold outline-none ring-focus ring-offset-3 ring-offset-surface transition-transform duration-100 disabled:pointer-events-none disabled:opacity-50 data-[focus-visible]:ring-2\",\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary:\n\t\t\t\t\"bg-primary text-primary-fg data-[hovered]:bg-primary/80\",\n\t\t\tsecondary:\n\t\t\t\t\"border border-border text-fg data-[hovered]:border-secondary data-[hovered]:bg-secondary\",\n\t\t\tghost:\n\t\t\t\t\"bg-transparent text-fg data-[hovered]:bg-secondary data-[hovered]:text-secondary-fg\",\n\t\t\tdanger:\n\t\t\t\t\"border border-transparent bg-danger text-danger-fg data-[hovered]:bg-danger/80\",\n\t\t},\n\t\tsize: {\n\t\t\tsm: \"px-2 py-1.5 text-sm\",\n\t\t\tmd: \"px-4 py-2.5 text-base\",\n\t\t\tlg: \"px-6 py-3.5 font-bold text-lg\",\n\t\t\ticon: \"size-9\",\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"primary\",\n\t\tsize: \"md\",\n\t},\n});\n\ntype ButtonVariantProps = VariantProps<typeof button>;\n\ninterface ButtonProps\n\textends Omit<AriaButtonProps, \"className\">,\n\t\tButtonVariantProps {\n\tclassName?: string;\n}\n\nconst Button = ({\n\tclassName,\n\tsize,\n\tvariant,\n\tchildren,\n\t...props\n}: ButtonProps) => (\n\t<AriaButton className={button({ className, size, variant })} {...props}>\n\t\t{children}\n\t</AriaButton>\n);\n\nButton.displayName = \"Button\";\n\nexport { Button };\nexport type { ButtonProps };\n",
"type": "registry:component"
"type": "registry:component",
"target": "components/ui/button.tsx"
}
],
"tailwind": {
Expand Down
Loading