Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
NODE_ENV=developmnet
NODE_ENV=developmnet
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix the typo in NODE_ENV value.

The value "developmnet" contains a typo and should be "development". This error will propagate to developers who copy this example file.

Apply this diff:

-NODE_ENV=developmnet
+NODE_ENV=development
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
NODE_ENV=developmnet
NODE_ENV=development
🤖 Prompt for AI Agents
In .env.example around lines 1 to 1, the NODE_ENV value has a typo
("developmnet"); update the value to the correct string "development" so example
consumers get the correct environment name.

ANALYZE=false
126 changes: 110 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thanks for your interest in contributing to Nurui. We're happy to have you here.
Thanks for your interest in contributing to Nur/ui. We're happy to have you here.

This document will guide you through the process of setting up the project locally, contributing components, and following our commit conventions.

Expand Down Expand Up @@ -61,14 +61,15 @@ Please ensure that:
- Any pull request made directly to the `main` branch **will be rejected**.

#### Correct PR:

`your-feature-branch ➡️ dev`

#### Not Allowed:

`your-feature-branch ➡️ main`

This helps us keep the `main` branch stable and production-ready.


## Folder Structure

```bash
Expand Down Expand Up @@ -140,7 +141,7 @@ NURUI/

## How to Add a New Component to Nurui

Follow these 4 simple steps to add a new UI component to the library.
Follow these 7 simple steps to add a new UI component to the library.

---

Expand All @@ -166,25 +167,21 @@ shiny-button-demo.tsx # Demo preview component

### Step 3: Register in componentRegistry.ts

Open `src/registry/componentRegistry.ts` and add the following:
Nur/ui now uses a dynamic registry system useing the function createEntry().

Open `src/registry/componentRegistry.ts` and add your entry:

Import the files:

```bash
import ShinyButtonCode from "@/components/nurui/shiny-button.tsx?raw";
import ShinyButtonDemo from "@/components/nurui/shiny-button-demo";
import ShinyButtonDemoCode from "@/components/nurui/shiny-button-demo.tsx?raw";

import { createEntry } from "@/utils/createEntry";

Add entry to the Index object:
export const componentsRegistry = {
shinyButton: createEntry("shiny-button", ["shiny-button"]),
};

shinyButton: {
preview: <ShinyButtonDemo />,
code: ShinyButtonDemoCode,
othersCode: [
{ fileName: "shiny-button", code: ShinyButtonCode },
],
},
## This automatically loads your preview and raw code dynamically.
## If your component doesn’t follow the -demo pattern, the system will handle it conditionally.
```

### Step 4: Create .mdx File for Docs
Expand Down Expand Up @@ -240,6 +237,103 @@ description: "A glowing button component with customizable animations."
| ...props | `button` | — | Standard button props |
```

### Step 5: Add to registry.json

This powers the web registry for component open in the v0.

Open `registry.json` and add your entry:

Import the files:

```bash
{
"$schema": "https://ui.shadcn.com/schema/registry.json",
"name": "nurui",
"homepage": "https://nurui.vercel.app",
"items": [
{
"name": "shiny-button",
"type": "registry:component",
"devDependencies": [],
"dependencies": ["react-icons", "clsx", "tailwind-merge"],
"registryDependencies": [],
"files": [
{
"path": "./src/components/nurui/shiny-button-demo.tsx",
"type": "registry:component"
},
{
"path": "./src/components/nurui/shiny-button.tsx",
"type": "registry:component"
}
]
}
]
}
## Also you can add more dependencies and files if needed.
```

### Step 6: Add to registry-cli.json (for CLI Support)

This enables users to install via:

```bash
npx nurui add shiny-button
```

Open `registry-cli.json` and add your entry:

Import the files:

```bash
{
"$schema": "https://ui.shadcn.com/schema/registry.json",
"name": "nurui",
"homepage": "https://nurui.vercel.app",
"items": [
{
"name": "shiny-button",
"type": "registry:component",
"devDependencies": [],
"dependencies": ["react-icons"],
"registryDependencies": [],
"files": [
{
"path": "./src/components/nurui/shiny-button.tsx",
"type": "registry:component"
}
]
}
]
}
## Also you can add more dependencies and files if needed.
## Note: do not need to add the demo file
```

### Step 7: Add Preview Page (Full Page Support)

NurUI supports live previews for each component at `/preview/[component]`

Open `src/app/preview/[component]/components-preview-registry.tsx` and add your entry:

```bash
import React from "react";
import dynamic from "next/dynamic";

export const componentsPreviewRegistry: Record<
string,
{ component: React.ComponentType }
> = {
"shiny-button": {
component: dynamic(
() => import("@/components/nurui/shiny-button-demo"),
),
}}

## If this component is not default export then use likt this:
import("@/components/nurui/shiny-button-demo").then((mod) => mod.TextButtonDemo)
```

🔚 Done!
Your component should now appear in the sidebar, render in the preview, and have complete documentation in MDX.

Expand Down
10 changes: 9 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import type { NextConfig } from "next";
import createMDX from "@next/mdx";
import withBundleAnalyzer from "@next/bundle-analyzer";

const isAnalyzerEnabled = process.env.ANALYZE === "true";

const analyzer = withBundleAnalyzer({
enabled: isAnalyzerEnabled,
});

const nextConfig: NextConfig = {
images: {
Expand Down Expand Up @@ -50,4 +57,5 @@ const withMDX = createMDX({
});

// Merge MDX config with Next.js config
export default withMDX(nextConfig);
// export default withMDX(nextConfig);
export default analyzer(withMDX(nextConfig));
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"analyze": "cross-env ANALYZE=true next build"
},
"dependencies": {
"@gsap/react": "^2.1.2",
Expand All @@ -25,6 +26,7 @@
"@vercel/analytics": "^1.5.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cross-env": "^10.1.0",
"dotted-map": "^2.2.3",
"gsap": "^3.13.0",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -61,6 +63,7 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@next/bundle-analyzer": "^15.5.4",
"@react-three/drei": "^10.6.1",
"@types/lodash": "^4.17.15",
"@types/matter-js": "^0.20.0",
Expand All @@ -75,6 +78,7 @@
"eslint-config-next": "15.1.7",
"postcss": "^8",
"raw-loader": "^4.0.2",
"tailwindcss": "^3.4.1"
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.2"
}
}
14 changes: 1 addition & 13 deletions registry-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,19 +470,7 @@
}
]
},
{
"name": "copy-button",
"type": "registry:component",
"devDependencies": [],
"dependencies": ["lucide-react", "lottie-react"],
"registryDependencies": [],
"files": [
{
"path": "./src/components/nurui/copy-button.tsx",
"type": "registry:component"
}
]
},


{
"name": "playing-card",
Expand Down
17 changes: 0 additions & 17 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -620,23 +620,6 @@
}
]
},
{
"name": "copy-button",
"type": "registry:component",
"devDependencies": [],
"dependencies": ["lucide-react", "lottie-react"],
"registryDependencies": [],
"files": [
{
"path": "./src/components/nurui/copy-button-demo.tsx",
"type": "registry:component"
},
{
"path": "./src/components/nurui/copy-button.tsx",
"type": "registry:component"
}
]
},

{
"name": "playing-card",
Expand Down
6 changes: 2 additions & 4 deletions src/app/(docs)/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import React from "react";
import { IChildren } from "@/types/types";
import { IChildren } from "@/types/common.type";
import ComponentsRightSidebar from "@/components/layout/components-layout/ComponentsRightSidebar";
import { useAppContext } from "@/context/AppContext";
import ComponentsFooter from "@/components/layout/components-layout/ComponentsFooter";
Expand All @@ -22,9 +22,7 @@ const Layout = ({ children }: IChildren) => {
"xl:w-[calc(100%-18rem)]": !isLeftSideBar,
})}
>
<main className="px-6 md:px-12 py-8">
{children}
</main>
<main className="px-6 md:px-12 py-8">{children}</main>
<ComponentsFooter />
</div>
<ComponentsRightSidebar />
Expand Down
2 changes: 0 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { AppProvider } from "@/context/AppContext";
import Navbar from "@/components/layout/Navbar";
import Footer from "@/components/layout/Footer";
import Banner from "@/components/ui/Banner";
// import SplashCursorDemo from "@/components/common/SplashCursorDemo";

const nunito = Nunito({
variable: "--font-nunito",
Expand Down Expand Up @@ -99,7 +98,6 @@ export default function RootLayout({
<ThemeProvider>
<Toaster />
<NProgressProvider />
{/* <SplashCursorDemo /> */}
<Banner />
<Navbar />
<MainContent>{children}</MainContent>
Expand Down
40 changes: 12 additions & 28 deletions src/app/preview/[component]/components-preview-registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ export const componentsPreviewRegistry: Record<
),
},
"animated-pricing": {
component: dynamic(() =>
import("@/components/nurui/animated-pricing-demo").then(
(mod) => mod.AnimatedPricingDemo,
),
component: dynamic(
() => import("@/components/nurui/animated-pricing-demo"),
),
},
"creative-pricing": {
component: dynamic(() =>
import("@/components/nurui/creative-pricing-demo").then(
(mod) => mod.CreativePricingDemo,
),
component: dynamic(
() => import("@/components/nurui/creative-pricing-demo"),
),
},
"grid-feature": {
Expand All @@ -56,18 +52,10 @@ export const componentsPreviewRegistry: Record<
),
},
"following-eye": {
component: dynamic(() =>
import("@/components/nurui/following-eye-demo").then(
(mod) => mod.FollowingEyeDemo,
),
),
component: dynamic(() => import("@/components/nurui/following-eye-demo")),
},
"animated-list": {
component: dynamic(() =>
import("@/components/nurui/animated-list-demo").then(
(mod) => mod.AnimatedListDemo,
),
),
component: dynamic(() => import("@/components/nurui/animated-list-demo")),
},
banner: {
component: dynamic(() => import("@/components/nurui/banner-demo")),
Expand Down Expand Up @@ -144,22 +132,18 @@ export const componentsPreviewRegistry: Record<
),
),
},
"play-button": {

"play-button": {
component: dynamic(() => import("@/components/nurui/play-button-demo")),
},
"copy-button": {
component: dynamic(() => import("@/components/nurui/copy-button-demo")),
},
// loaders

"ripple-loader": {
// loaders
"ripple-loader": {
component: dynamic(() => import("@/components/nurui/ripple-loader-demo")),
},
"counter-loading": {
component: dynamic(() => import("@/components/nurui/counter-loading-demo")),
"counter-loader": {
component: dynamic(() => import("@/components/nurui/counter-loader-demo")),
},
Comment on lines +140 to 146
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

New loader entries look good; confirm slug consistency

The new "counter-loader" preview entry aligns with the rename. LGTM. Please also ensure no stale "counter-loading" references remain in routes/docs.


🏁 Script executed:

#!/bin/bash
# Find any lingering "counter-loading" references
rg -nP 'counter-loading'

Length of output: 1359


Update stale “counter-loading” references in registry and docs

  • Change all occurrences of "counter-loading" to "counter-loader" (names, slugs, titles)
  • Update file paths in registry.json, registry-cli.json, public/r/*.json, and src/content/docs/counter-loader.mdx to use counter-loader-demo.tsx and counter-loader.tsx
🤖 Prompt for AI Agents
In src/app/preview/[component]/components-preview-registry.tsx around lines 140
to 146, the registry still references the old "counter-loading" naming and
possibly stale file paths; update the key/name/slug/title occurrences from
"counter-loading" to "counter-loader" and ensure the dynamic import paths point
to the new files (use "@/components/nurui/counter-loader-demo" for the demo
component and "@/components/nurui/counter-loader" where appropriate). Also apply
the same rename across registry.json and registry-cli.json, every
public/r/*.json entry, and update src/content/docs/counter-loader.mdx to
reference counter-loader-demo.tsx and counter-loader.tsx filenames and use the
new slug/title "counter-loader".



// cards
"playing-card": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CLICommandButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState } from "react";
import { Button } from "../ui/button";
import { FaTerminal } from "react-icons/fa";
import { cn } from "@/lib/utils";
import IClassName from "@/types/types";
import IClassName from "@/types/common.type";
import { FaCheck } from "react-icons/fa6";

interface ClipboardButtonProps extends IClassName {
Expand Down
Loading