Skip to content

Commit 266a2b4

Browse files
authored
Merge pull request #102 from afsar-dev/dev
Dev
2 parents 7971e5c + 5cb24ec commit 266a2b4

20 files changed

+37096
-57
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"react-hot-toast": "^2.5.2",
4545
"react-icons": "^5.4.0",
4646
"react-intersection-observer": "^9.16.0",
47+
"react-lottie": "^1.2.10",
4748
"react-syntax-highlighter": "^15.6.1",
4849
"react-toggle-dark-mode": "^1.1.1",
4950
"remark-gfm": "^4.0.1",
@@ -67,12 +68,12 @@
6768
"@types/nprogress": "^0.2.3",
6869
"@types/react": "^19",
6970
"@types/react-dom": "^19",
71+
"@types/react-lottie": "^1.2.10",
7072
"@types/react-syntax-highlighter": "^15.5.13",
7173
"eslint": "^9",
7274
"eslint-config-next": "15.1.7",
7375
"postcss": "^8",
7476
"raw-loader": "^4.0.2",
7577
"tailwindcss": "^3.4.1"
76-
},
77-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
78+
}
7879
}

public/r/copy-button.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
3+
"name": "copy-button",
4+
"type": "registry:component",
5+
"dependencies": [
6+
"lucide-react",
7+
"lottie-react"
8+
],
9+
"devDependencies": [],
10+
"registryDependencies": [],
11+
"files": [
12+
{
13+
"path": "./src/components/nurui/copy-button-demo.tsx",
14+
"content": "import React from \"react\";\nimport CopyButton from \"@/components/nurui/copy-button\";\n\nconst CopyButtonDemo = () => {\n return (\n <div className=\"flex items-center justify-center min-h-[20rem]\">\n <CopyButton\n text=\"example@gmail.com\"\n defaultLabel=\"Copy email address\"\n successLabel=\"Copied!\"\n />\n </div>\n );\n};\n\nexport default CopyButtonDemo;\n",
15+
"type": "registry:component"
16+
},
17+
{
18+
"path": "./src/components/nurui/copy-button.tsx",
19+
"content": "\"use client\";\n\nimport { Copy } from \"lucide-react\";\nimport React, { useState } from \"react\";\nimport Lottie from \"lottie-react\";\nimport animationData from \"./data/confetti.json\";\n\ninterface CopyButtonProps {\n text: string; // the text/email to copy\n defaultLabel?: string; // label before copying\n successLabel?: string; // label after copying\n}\n\nconst CopyButton: React.FC<CopyButtonProps> = ({\n text,\n defaultLabel = \"Copy my email address\",\n successLabel = \"Email is Copied!\",\n}) => {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = () => {\n navigator.clipboard.writeText(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000); // reset after 2s\n };\n\n return (\n <button\n onClick={handleCopy}\n className=\"relative mt-5 bg-fuchsia-950 px-4 py-2 rounded-lg font-bold flex gap-2 items-center text-white transition-colors\"\n style={{ minWidth: \"220px\" }} // ✅ lock button width (tweak px if needed)\n >\n <Copy className=\"w-5 h-5\" />\n\n {/* keep label width stable by wrapping */}\n <span className=\"whitespace-nowrap text-center flex-1\">\n {copied ? successLabel : defaultLabel}\n </span>\n\n {copied && (\n <div className=\"absolute inset-0 flex items-center justify-center pointer-events-none\">\n <Lottie\n animationData={animationData}\n loop={false}\n autoplay={true}\n style={{ width: 200, height: 200 }}\n />\n </div>\n )}\n </button>\n );\n};\n\nexport default CopyButton;\n",
20+
"type": "registry:component"
21+
}
22+
]
23+
}

public/r/play-button.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
3+
"name": "play-button",
4+
"type": "registry:component",
5+
"dependencies": [
6+
"react-icons"
7+
],
8+
"devDependencies": [],
9+
"registryDependencies": [],
10+
"files": [
11+
{
12+
"path": "./src/components/nurui/play-button-demo.tsx",
13+
"content": "import React from \"react\";\nimport PlayButton from \"@/components/nurui/play-button\";\n\nconst PlayButtonDemo = () => {\n return (\n <div className=\"flex items-center justify-center min-h-[30rem]\">\n <PlayButton text=\"Play Now\" />\n </div>\n );\n};\n\nexport default PlayButtonDemo;\n",
14+
"type": "registry:component"
15+
},
16+
{
17+
"path": "./src/components/nurui/play-button.tsx",
18+
"content": "import React from 'react';\nimport { FaPlay } from 'react-icons/fa';\n\nconst PlayButton = ({ text }: { text: string }) => {\n return (\n <button className=\"relative group text-white transition-all flex items-center justify-center whitespace-nowrap rounded-lg hover:rotate-[3deg] will-change-transform duration-300 shadow-lg hover:shadow-xl h-14 text-lg pl-[5rem] pr-6 bg-fuchsia-950 shadow-fuchsia-950/30 hover:shadow-fuchsia-950/30\">\n <div className=\"absolute left-0 top-0 mt-1 ml-1 bg-white text-fuchsia-950 p-[0.35rem] bottom-1 group-hover:w-[calc(100%-0.5rem)] transition-all rounded-md duration-300 h-12 w-12 flex items-center justify-center\">\n <FaPlay className=\"h-6 w-6\" />\n </div>\n <div>{text}</div>\n </button>\n );\n};\n\nexport default PlayButton;\n",
19+
"type": "registry:component"
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)