From fbb9cd75c8cc2a77a8741fe5bae2ac8f5672d0ba Mon Sep 17 00:00:00 2001 From: Ouassim Abdelmalek Ghribi Date: Sun, 21 Dec 2025 17:09:01 +0100 Subject: [PATCH 1/9] refactor: cleaned up project in preparation for v2 --- .commitlintrc | 1 - .github/ISSUE_TEMPLATE/bug_report.md | 40 - .github/ISSUE_TEMPLATE/documentation.md | 19 - .github/ISSUE_TEMPLATE/feature_request.md | 19 - .gitignore | 43 - .husky/commit-msg | 1 - .husky/pre-commit | 1 - .husky/pre-push | 1 - .lintstagedrc.js | 13 - .prettierignore | 2 - .prettierrc | 30 - LICENSE | 21 - README.md | 120 - __registry__/index.tsx | 253 - app/(app)/docs/[[...slug]]/page.tsx | 154 - app/(app)/docs/layout.tsx | 21 - app/(app)/docs/not-found.tsx | 36 - app/(app)/layout.tsx | 16 - app/(app)/page.tsx | 45 - app/layout.tsx | 111 - app/not-found.tsx | 36 - components.json | 21 - components/active-theme.tsx | 90 - components/callout.tsx | 18 - components/changing-scramble-text.tsx | 41 - components/code-block-command.tsx | 100 - components/code-block-wrapper.tsx | 58 - components/command-menu.tsx | 130 - components/component-preview.tsx | 118 - components/component-source.tsx | 26 - components/contribute.tsx | 73 - components/copy-button.tsx | 46 - components/doc-grid-pattern.tsx | 97 - components/docs-nav.tsx | 79 - components/grid-pattern.tsx | 72 - components/icons.tsx | 74 - components/main-nav.tsx | 36 - components/mdx-components.tsx | 300 - components/mobile-nav.tsx | 129 - components/scramble-text.tsx | 24 - components/site-footer.tsx | 33 - components/site-header.tsx | 43 - components/theme-customizer.tsx | 172 - components/toc.tsx | 106 - components/ui/accordion.tsx | 57 - components/ui/alert.tsx | 59 - components/ui/aspect-ratio.tsx | 7 - components/ui/badge.tsx | 36 - components/ui/button.tsx | 57 - components/ui/collapsible.tsx | 11 - components/ui/command.tsx | 153 - components/ui/dialog.tsx | 122 - components/ui/drawer.tsx | 118 - components/ui/label.tsx | 26 - components/ui/popover.tsx | 33 - components/ui/skeleton.tsx | 15 - components/ui/sonner.tsx | 31 - components/ui/tabs.tsx | 55 - components/ui/tooltip.tsx | 32 - config/colors.ts | 58 - config/docs.ts | 81 - config/site.ts | 18 - content/docs/hooks/use-boolean.mdx | 80 - content/docs/hooks/use-copy-to-clipboard.mdx | 77 - content/docs/hooks/use-counter.mdx | 79 - content/docs/hooks/use-debounce-callback.mdx | 81 - content/docs/hooks/use-document-title.mdx | 59 - content/docs/hooks/use-interval.mdx | 97 - .../hooks/use-isomorphic-layout-effect.mdx | 64 - content/docs/hooks/use-mouse-position.mdx | 95 - content/docs/hooks/use-timeout.mdx | 70 - content/docs/hooks/use-toggle.mdx | 92 - content/docs/hooks/use-unmount.mdx | 61 - contentlayer.config.ts | 101 - eslint.config.mjs | 37 - hooks/use-config.ts | 14 - hooks/use-meta-color.ts | 25 - lib/fonts.ts | 11 - lib/github.ts | 25 - lib/rehype-component.ts | 135 - lib/rehype-npm-command.ts | 90 - lib/toc.ts | 81 - lib/utils.ts | 10 - next.config.ts | 28 - package.json | 80 - pnpm-lock.yaml | 9163 ----------------- postcss.config.mjs | 8 - public/android-chrome-192x192.png | Bin 13204 -> 0 bytes public/android-chrome-512x512.png | Bin 47785 -> 0 bytes public/apple-touch-icon.png | Bin 12378 -> 0 bytes public/favicon-16x16.png | Bin 441 -> 0 bytes public/favicon-32x32.png | Bin 1138 -> 0 bytes public/favicon.ico | Bin 15406 -> 0 bytes public/hero.png | Bin 365772 -> 0 bytes public/og.png | Bin 569838 -> 0 bytes public/r/hooks/use-boolean.json | 12 - .../r/hooks/use-copy-to-clipboard-demo.json | 12 - public/r/hooks/use-copy-to-clipboard.json | 12 - public/r/hooks/use-counter.json | 12 - public/r/hooks/use-debounce-callback.json | 15 - public/r/hooks/use-document-title-demo.json | 12 - public/r/hooks/use-document-title.json | 12 - public/r/hooks/use-interval-demo.json | 12 - public/r/hooks/use-interval.json | 12 - .../r/hooks/use-isomorphic-layout-effect.json | 12 - public/r/hooks/use-mouse-position-demo.json | 12 - public/r/hooks/use-mouse-position.json | 12 - public/r/hooks/use-timeout-demo.json | 12 - public/r/hooks/use-timeout.json | 12 - public/r/hooks/use-toggle.json | 12 - public/r/hooks/use-unmount.json | 12 - public/r/index.json | 170 - public/site.webmanifest | 19 - .../examples/use-copy-to-clipboard-demo.tsx | 28 - registry/examples/use-document-title-demo.tsx | 21 - registry/examples/use-interval-demo.tsx | 32 - registry/examples/use-mouse-position-demo.tsx | 87 - registry/examples/use-timeout-demo.tsx | 58 - registry/hooks/use-boolean.tsx | 32 - registry/hooks/use-copy-to-clipboard.tsx | 37 - registry/hooks/use-counter.tsx | 35 - registry/hooks/use-debounce-callback.tsx | 65 - registry/hooks/use-document-title.tsx | 9 - registry/hooks/use-interval.tsx | 21 - .../hooks/use-isomorphic-layout-effect.tsx | 6 - registry/hooks/use-mouse-position.tsx | 57 - registry/hooks/use-timeout.tsx | 21 - registry/hooks/use-toggle.tsx | 15 - registry/hooks/use-unmount.tsx | 16 - registry/index.tsx | 5 - registry/registry-examples.ts | 54 - registry/registry-hooks.ts | 117 - registry/schema.ts | 28 - scripts/build-registry.mts | 84 - styles/globals.css | 215 - styles/mdx.css | 81 - styles/themes.css | 490 - tsconfig.json | 36 - tsconfig.scripts.json | 13 - types/nav.ts | 15 - types/unist.ts | 31 - 141 files changed, 16594 deletions(-) delete mode 100644 .commitlintrc delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/documentation.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .gitignore delete mode 100644 .husky/commit-msg delete mode 100644 .husky/pre-commit delete mode 100644 .husky/pre-push delete mode 100644 .lintstagedrc.js delete mode 100644 .prettierignore delete mode 100644 .prettierrc delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 __registry__/index.tsx delete mode 100644 app/(app)/docs/[[...slug]]/page.tsx delete mode 100644 app/(app)/docs/layout.tsx delete mode 100644 app/(app)/docs/not-found.tsx delete mode 100644 app/(app)/layout.tsx delete mode 100644 app/(app)/page.tsx delete mode 100644 app/layout.tsx delete mode 100644 app/not-found.tsx delete mode 100644 components.json delete mode 100644 components/active-theme.tsx delete mode 100644 components/callout.tsx delete mode 100644 components/changing-scramble-text.tsx delete mode 100644 components/code-block-command.tsx delete mode 100644 components/code-block-wrapper.tsx delete mode 100644 components/command-menu.tsx delete mode 100644 components/component-preview.tsx delete mode 100644 components/component-source.tsx delete mode 100644 components/contribute.tsx delete mode 100644 components/copy-button.tsx delete mode 100644 components/doc-grid-pattern.tsx delete mode 100644 components/docs-nav.tsx delete mode 100644 components/grid-pattern.tsx delete mode 100644 components/icons.tsx delete mode 100644 components/main-nav.tsx delete mode 100644 components/mdx-components.tsx delete mode 100644 components/mobile-nav.tsx delete mode 100644 components/scramble-text.tsx delete mode 100644 components/site-footer.tsx delete mode 100644 components/site-header.tsx delete mode 100644 components/theme-customizer.tsx delete mode 100644 components/toc.tsx delete mode 100644 components/ui/accordion.tsx delete mode 100644 components/ui/alert.tsx delete mode 100644 components/ui/aspect-ratio.tsx delete mode 100644 components/ui/badge.tsx delete mode 100644 components/ui/button.tsx delete mode 100644 components/ui/collapsible.tsx delete mode 100644 components/ui/command.tsx delete mode 100644 components/ui/dialog.tsx delete mode 100644 components/ui/drawer.tsx delete mode 100644 components/ui/label.tsx delete mode 100644 components/ui/popover.tsx delete mode 100644 components/ui/skeleton.tsx delete mode 100644 components/ui/sonner.tsx delete mode 100644 components/ui/tabs.tsx delete mode 100644 components/ui/tooltip.tsx delete mode 100644 config/colors.ts delete mode 100644 config/docs.ts delete mode 100644 config/site.ts delete mode 100644 content/docs/hooks/use-boolean.mdx delete mode 100644 content/docs/hooks/use-copy-to-clipboard.mdx delete mode 100644 content/docs/hooks/use-counter.mdx delete mode 100644 content/docs/hooks/use-debounce-callback.mdx delete mode 100644 content/docs/hooks/use-document-title.mdx delete mode 100644 content/docs/hooks/use-interval.mdx delete mode 100644 content/docs/hooks/use-isomorphic-layout-effect.mdx delete mode 100644 content/docs/hooks/use-mouse-position.mdx delete mode 100644 content/docs/hooks/use-timeout.mdx delete mode 100644 content/docs/hooks/use-toggle.mdx delete mode 100644 content/docs/hooks/use-unmount.mdx delete mode 100644 contentlayer.config.ts delete mode 100644 eslint.config.mjs delete mode 100644 hooks/use-config.ts delete mode 100644 hooks/use-meta-color.ts delete mode 100644 lib/fonts.ts delete mode 100644 lib/github.ts delete mode 100644 lib/rehype-component.ts delete mode 100644 lib/rehype-npm-command.ts delete mode 100644 lib/toc.ts delete mode 100644 lib/utils.ts delete mode 100644 next.config.ts delete mode 100644 package.json delete mode 100644 pnpm-lock.yaml delete mode 100644 postcss.config.mjs delete mode 100644 public/android-chrome-192x192.png delete mode 100644 public/android-chrome-512x512.png delete mode 100644 public/apple-touch-icon.png delete mode 100644 public/favicon-16x16.png delete mode 100644 public/favicon-32x32.png delete mode 100644 public/favicon.ico delete mode 100644 public/hero.png delete mode 100644 public/og.png delete mode 100644 public/r/hooks/use-boolean.json delete mode 100644 public/r/hooks/use-copy-to-clipboard-demo.json delete mode 100644 public/r/hooks/use-copy-to-clipboard.json delete mode 100644 public/r/hooks/use-counter.json delete mode 100644 public/r/hooks/use-debounce-callback.json delete mode 100644 public/r/hooks/use-document-title-demo.json delete mode 100644 public/r/hooks/use-document-title.json delete mode 100644 public/r/hooks/use-interval-demo.json delete mode 100644 public/r/hooks/use-interval.json delete mode 100644 public/r/hooks/use-isomorphic-layout-effect.json delete mode 100644 public/r/hooks/use-mouse-position-demo.json delete mode 100644 public/r/hooks/use-mouse-position.json delete mode 100644 public/r/hooks/use-timeout-demo.json delete mode 100644 public/r/hooks/use-timeout.json delete mode 100644 public/r/hooks/use-toggle.json delete mode 100644 public/r/hooks/use-unmount.json delete mode 100644 public/r/index.json delete mode 100644 public/site.webmanifest delete mode 100644 registry/examples/use-copy-to-clipboard-demo.tsx delete mode 100644 registry/examples/use-document-title-demo.tsx delete mode 100644 registry/examples/use-interval-demo.tsx delete mode 100644 registry/examples/use-mouse-position-demo.tsx delete mode 100644 registry/examples/use-timeout-demo.tsx delete mode 100644 registry/hooks/use-boolean.tsx delete mode 100644 registry/hooks/use-copy-to-clipboard.tsx delete mode 100644 registry/hooks/use-counter.tsx delete mode 100644 registry/hooks/use-debounce-callback.tsx delete mode 100644 registry/hooks/use-document-title.tsx delete mode 100644 registry/hooks/use-interval.tsx delete mode 100644 registry/hooks/use-isomorphic-layout-effect.tsx delete mode 100644 registry/hooks/use-mouse-position.tsx delete mode 100644 registry/hooks/use-timeout.tsx delete mode 100644 registry/hooks/use-toggle.tsx delete mode 100644 registry/hooks/use-unmount.tsx delete mode 100644 registry/index.tsx delete mode 100644 registry/registry-examples.ts delete mode 100644 registry/registry-hooks.ts delete mode 100644 registry/schema.ts delete mode 100644 scripts/build-registry.mts delete mode 100644 styles/globals.css delete mode 100644 styles/mdx.css delete mode 100644 styles/themes.css delete mode 100644 tsconfig.json delete mode 100644 tsconfig.scripts.json delete mode 100644 types/nav.ts delete mode 100644 types/unist.ts diff --git a/.commitlintrc b/.commitlintrc deleted file mode 100644 index d3d7f0c..0000000 --- a/.commitlintrc +++ /dev/null @@ -1 +0,0 @@ -{ "extends": ["@commitlint/config-conventional"] } diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 9b77ea7..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "" -labels: "" -assignees: "" ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - -- OS: [e.g. iOS] -- Browser [e.g. chrome, safari] -- Version [e.g. 22] - -**Smartphone (please complete the following information):** - -- Device: [e.g. iPhone6] -- OS: [e.g. iOS8.1] -- Browser [e.g. stock browser, safari] -- Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md deleted file mode 100644 index 8c1bfb4..0000000 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Documentation -about: Suggest an edit for the documentation -title: "" -labels: "" -assignees: "" ---- - -**Describe the documentation change** -A clear and concise description of what you'd like to see changed or added in the documentation. - -**Current documentation** -If applicable, provide a link or reference to the current documentation that needs to be updated. - -**Proposed change** -Describe the change you'd like to see in the documentation. Be as specific as possible. - -**Additional context** -Add any other context or screenshots about the documentation request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 2bc5d5f..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "" -labels: "" -assignees: "" ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6b2c49f..0000000 --- a/.gitignore +++ /dev/null @@ -1,43 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/versions - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# env files (can opt-in for committing if needed) -.env* - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts - -# contentlayer -.contentlayer diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100644 index c48ae69..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1 +0,0 @@ -pnpm dlx commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index cb2c84d..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -pnpm lint-staged diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100644 index 0c958d2..0000000 --- a/.husky/pre-push +++ /dev/null @@ -1 +0,0 @@ -pnpm run build diff --git a/.lintstagedrc.js b/.lintstagedrc.js deleted file mode 100644 index e2704cc..0000000 --- a/.lintstagedrc.js +++ /dev/null @@ -1,13 +0,0 @@ -const path = require("path") - -const buildEslintCommand = (filenames) => - `next lint --fix --file ${filenames - .map((f) => path.relative(process.cwd(), f)) - .join(" --file ")}` - -const prettierCommand = "prettier --write" - -module.exports = { - "*.{js,jsx,ts,tsx}": [prettierCommand, buildEslintCommand], - "*.{json,css,md}": [prettierCommand], -} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index b90a368..0000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.next diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index e565ae2..0000000 --- a/.prettierrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "endOfLine": "lf", - "semi": false, - "singleQuote": false, - "tabWidth": 2, - "trailingComma": "es5", - "plugins": [ - "prettier-plugin-tailwindcss", - "@ianvs/prettier-plugin-sort-imports" - ], - "importOrder": [ - "^(react/(.*)$)|^(react$)", - "^(next/(.*)$)|^(next$)", - "", - "", - "^types$", - "^@/types/(.*)$", - "^@/config/(.*)$", - "^@/lib/(.*)$", - "^@/hooks/(.*)$", - "^@/components/ui/(.*)$", - "^@/components/(.*)$", - "^@/styles/(.*)$", - "^@/app/(.*)$", - "^@/registry/(.*)$", - "", - "^[./]" - ], - "importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"] -} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 16bdae5..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Ghribi Ouassim - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 728cc22..0000000 --- a/README.md +++ /dev/null @@ -1,120 +0,0 @@ - - -

hookcn

- -

- A collection of reusable react hooks that you can easily copy and paste into your apps or add directly through the shadcn CLI. -
-
- Demo - · - Report Bug - · - Request Feature -

- -## Table of Contents - -- [Table of Contents](#table-of-contents) -- [About The Project](#about-the-project) -- [Installation](#installation) -- [Usage](#usage) -- [Roadmap](#roadmap) -- [Contributing](#contributing) -- [License](#license) -- [Contact](#contact) -- [Acknowledgments](#acknowledgments) - - - -## About The Project - -[![hookcn Screen Shot][product-screenshot]](https://hookcn.ouassim.tech) - -This project offers a collection of reusable React hooks to simplify common tasks like state management, timeouts, and element visibility. Inspired by [shadcn/ui](https://ui.shadcn.com), it lets you copy hooks directly or use a the [shadcn/ui CLI](https://ui.shadcn.com/docs/cli) for easy integration. Each hook is designed with best practices for clean, efficient, and maintainable code. - -

(back to top)

- - - -## Installation - -1. Clone the repo - - ```sh - git clone https://github.com/strlrd-29/hookcn - ``` - -2. Navigate to project dir - - ```sh - cd hookcn - ``` - -3. Install NPM packages - - ```sh - pnpm install - ``` - -

(back to top)

- - - -## Usage - -Start the dev server - -```sh -pnpm dev -``` - -Open your browser and navigate to [http://localhost:3000](http://localhost:3000) to see the application in action. - -

(back to top)

- - - - - -## Contributing - -Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. - -If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". -Don't forget to give the project a star! Thanks again! - -1. Fork the Project -2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) -3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) -4. Push to the Branch (`git push origin feature/AmazingFeature`) -5. Open a Pull Request - - - -## License - -Distributed under the MIT License. See `LICENSE` for more information. - -

(back to top)

- - - -## Contact - -Ghribi Ouassim Abdelmalek - [@strlrd29](https://twitter.com/strlrd29) - - -Project Link: [hookcn.ouassim.tech](https://hookcn.ouassim.tech) - -

(back to top)

- - - -## Acknowledgments - -- [usehook-ts](https://usehooks-ts.com/) -- [usehooks](https://usehooks.com/) - -

(back to top)

- -[product-screenshot]: public/hero.png diff --git a/__registry__/index.tsx b/__registry__/index.tsx deleted file mode 100644 index 0db9146..0000000 --- a/__registry__/index.tsx +++ /dev/null @@ -1,253 +0,0 @@ -/* eslint-disable */ -// -// @ts-nocheck -// This file is autogenerated by scripts/build-registry.ts -// Do not edit this file directly. -import * as React from "react" - -export const Index: Record = { - "use-boolean": { - name: "use-boolean", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-boolean.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy(() => import("@/registry/hooks/use-boolean.tsx")), - source: "", - }, - "use-toggle": { - name: "use-toggle", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-toggle.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy(() => import("@/registry/hooks/use-toggle.tsx")), - source: "", - }, - "use-copy-to-clipboard": { - name: "use-copy-to-clipboard", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-copy-to-clipboard.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/hooks/use-copy-to-clipboard.tsx") - ), - source: "", - }, - "use-unmount": { - name: "use-unmount", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-unmount.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy(() => import("@/registry/hooks/use-unmount.tsx")), - source: "", - }, - "use-debounce-callback": { - name: "use-debounce-callback", - type: "registry:hook", - registryDependencies: ["https://hookcn.ouassim.tech/r/use-unmount"], - files: [ - { - path: "registry/hooks/use-debounce-callback.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/hooks/use-debounce-callback.tsx") - ), - source: "", - }, - "use-isomorphic-layout-effect": { - name: "use-isomorphic-layout-effect", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-isomorphic-layout-effect.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/hooks/use-isomorphic-layout-effect.tsx") - ), - source: "", - }, - "use-interval": { - name: "use-interval", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-interval.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy(() => import("@/registry/hooks/use-interval.tsx")), - source: "", - }, - "use-timeout": { - name: "use-timeout", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-timeout.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy(() => import("@/registry/hooks/use-timeout.tsx")), - source: "", - }, - "use-document-title": { - name: "use-document-title", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-document-title.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/hooks/use-document-title.tsx") - ), - source: "", - }, - "use-counter": { - name: "use-counter", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-counter.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy(() => import("@/registry/hooks/use-counter.tsx")), - source: "", - }, - "use-mouse-position": { - name: "use-mouse-position", - type: "registry:hook", - registryDependencies: undefined, - files: [ - { - path: "registry/hooks/use-mouse-position.tsx", - type: "registry:hook", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/hooks/use-mouse-position.tsx") - ), - source: "", - }, - "use-copy-to-clipboard-demo": { - name: "use-copy-to-clipboard-demo", - type: "registry:example", - registryDependencies: undefined, - files: [ - { - path: "registry/examples/use-copy-to-clipboard-demo.tsx", - type: "registry:example", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/examples/use-copy-to-clipboard-demo.tsx") - ), - source: "", - }, - "use-interval-demo": { - name: "use-interval-demo", - type: "registry:example", - registryDependencies: undefined, - files: [ - { - path: "registry/examples/use-interval-demo.tsx", - type: "registry:example", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/examples/use-interval-demo.tsx") - ), - source: "", - }, - "use-timeout-demo": { - name: "use-timeout-demo", - type: "registry:example", - registryDependencies: undefined, - files: [ - { - path: "registry/examples/use-timeout-demo.tsx", - type: "registry:example", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/examples/use-timeout-demo.tsx") - ), - source: "", - }, - "use-document-title-demo": { - name: "use-document-title-demo", - type: "registry:example", - registryDependencies: undefined, - files: [ - { - path: "registry/examples/use-document-title-demo.tsx", - type: "registry:example", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/examples/use-document-title-demo.tsx") - ), - source: "", - }, - "use-mouse-position-demo": { - name: "use-mouse-position-demo", - type: "registry:example", - registryDependencies: undefined, - files: [ - { - path: "registry/examples/use-mouse-position-demo.tsx", - type: "registry:example", - target: "", - }, - ], - component: React.lazy( - () => import("@/registry/examples/use-mouse-position-demo.tsx") - ), - source: "", - }, -} diff --git a/app/(app)/docs/[[...slug]]/page.tsx b/app/(app)/docs/[[...slug]]/page.tsx deleted file mode 100644 index 275135b..0000000 --- a/app/(app)/docs/[[...slug]]/page.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import { Metadata } from "next" -import { notFound } from "next/navigation" -import { allDocs } from "contentlayer/generated" -import { ChevronRightIcon, ExternalLinkIcon } from "lucide-react" -import { Balancer } from "react-wrap-balancer" - -import { siteConfig } from "@/config/site" -import { getTableOfContents } from "@/lib/toc" -import { absoluteUrl, cn } from "@/lib/utils" -import { Mdx } from "@/components/mdx-components" -import { DashboardTableOfContents } from "@/components/toc" - -import "@/styles/mdx.css" - -import Link from "next/link" - -import { badgeVariants } from "@/components/ui/badge" -import { Contribute } from "@/components/contribute" -import { DocGridPattern } from "@/components/doc-grid-pattern" -import { ScrambleText } from "@/components/scramble-text" - -interface DocPageProps { - params: { - slug: string[] - } -} - -async function getDocFromParams({ params }: DocPageProps) { - const slug = params.slug?.join("/") || "" - const doc = allDocs.find((doc) => doc.slugAsParams === slug) - - if (!doc) { - return null - } - - return doc -} - -export async function generateMetadata(props: { - params: Promise -}): Promise { - const params = await props.params - const doc = await getDocFromParams({ params }) - - if (!doc) { - return {} - } - - return { - title: doc.title, - description: doc.description, - openGraph: { - title: doc.title, - description: doc.description, - type: "article", - url: absoluteUrl(doc.slug), - images: [ - { - url: siteConfig.ogImage, - width: 1200, - height: 630, - alt: siteConfig.name, - }, - ], - }, - twitter: { - card: "summary_large_image", - title: doc.title, - description: doc.description, - images: [siteConfig.ogImage], - creator: "@strlrd29", - }, - } -} - -export async function generateStaticParams(): Promise< - DocPageProps["params"][] -> { - return allDocs.map((doc) => ({ - slug: doc.slugAsParams.split("/"), - })) -} - -export default async function DocPage(props: { - params: Promise -}) { - const params = await props.params - - const doc = await getDocFromParams({ params }) - - if (!doc) { - notFound() - } - - const toc = await getTableOfContents(doc.body.raw) - - return ( - <> - -
-
-
-
Docs
- -
{doc.title}
-
-
- - {doc.description && ( -

- {doc.description} -

- )} -
- {doc.links ? ( -
- {Object.entries(doc.links).map(([k, v]) => ( - - {k} - - - ))} -
- ) : null} -
- -
-
-
-
-
- {doc.toc && } - -
-
-
-
- - ) -} diff --git a/app/(app)/docs/layout.tsx b/app/(app)/docs/layout.tsx deleted file mode 100644 index 1490321..0000000 --- a/app/(app)/docs/layout.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from "react" - -import { docsConfig } from "@/config/docs" -import { DocsNav } from "@/components/docs-nav" - -interface DocsLayoutProps { - children: React.ReactNode -} - -export default function DocsLayout({ children }: DocsLayoutProps) { - return ( -
- - {children} -
- ) -} diff --git a/app/(app)/docs/not-found.tsx b/app/(app)/docs/not-found.tsx deleted file mode 100644 index 88695c2..0000000 --- a/app/(app)/docs/not-found.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client" - -import Link from "next/link" -import { useRouter } from "next/navigation" -import { AlertTriangleIcon, ChevronLeftIcon, HouseIcon } from "lucide-react" - -import { Button, buttonVariants } from "@/components/ui/button" - -export default function NotFound() { - const router = useRouter() - return ( -
-
-

- -

-

- Page not found -

-

- The page you are looking for doesn't exist. -

-
- - - - Take me home - -
-
-
- ) -} diff --git a/app/(app)/layout.tsx b/app/(app)/layout.tsx deleted file mode 100644 index 4a69e56..0000000 --- a/app/(app)/layout.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { SiteFooter } from "@/components/site-footer" -import { SiteHeader } from "@/components/site-header" - -interface AppLayoutProps { - children: React.ReactNode -} - -export default function AppLayout({ children }: AppLayoutProps) { - return ( -
- -
{children}
- -
- ) -} diff --git a/app/(app)/page.tsx b/app/(app)/page.tsx deleted file mode 100644 index 62e97b0..0000000 --- a/app/(app)/page.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import Link from "next/link" -import Balancer from "react-wrap-balancer" - -import { cn } from "@/lib/utils" -import { buttonVariants } from "@/components/ui/button" -import { ChangingScrambleText } from "@/components/changing-scramble-text" -import { GridPattern } from "@/components/grid-pattern" - -export default function Home() { - return ( -
-
-
- - - A collection of reusable react hooks that you can easily copy and - paste into your apps or add directly through the shadcn CLI. - -
- - Explore the docs - -
- -
- ) -} diff --git a/app/layout.tsx b/app/layout.tsx deleted file mode 100644 index 7e19863..0000000 --- a/app/layout.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import type { Metadata, Viewport } from "next" -import { ThemeProvider } from "next-themes" - -import { META_THEME_COLORS, siteConfig } from "@/config/site" -import { fontMono, fontSans } from "@/lib/fonts" -import { cn } from "@/lib/utils" -import { TooltipProvider } from "@/components/ui/tooltip" - -import "@/styles/globals.css" - -import { Toaster } from "@/components/ui/sonner" -import { ActiveThemeProvider } from "@/components/active-theme" - -export const metadata: Metadata = { - title: { - default: siteConfig.name, - template: `%s - ${siteConfig.name}`, - }, - metadataBase: new URL(siteConfig.url), - description: siteConfig.description, - keywords: [ - "Next.js", - "React", - "Tailwind CSS", - "Server Components", - "Radix UI", - ], - authors: [ - { - name: "strlrd-29", - url: "https://ouassim.tech", - }, - ], - creator: "strlrd-29", - openGraph: { - type: "website", - locale: "en_US", - url: siteConfig.url, - title: siteConfig.name, - description: siteConfig.description, - siteName: siteConfig.name, - images: [ - { - url: siteConfig.ogImage, - width: 1200, - height: 630, - alt: siteConfig.name, - }, - ], - }, - twitter: { - card: "summary_large_image", - title: siteConfig.name, - description: siteConfig.description, - images: [siteConfig.ogImage], - creator: "@strlrd29", - }, - icons: { - icon: "/favicon.ico", - shortcut: "/favicon-16x16.png", - apple: "/apple-touch-icon.png", - }, - manifest: `${siteConfig.url}/site.webmanifest`, -} - -export const viewport: Viewport = { - themeColor: META_THEME_COLORS.light, -} - -interface RootLayoutProps { - children: React.ReactNode -} - -export default function RootLayout({ children }: RootLayoutProps) { - return ( - - - - - - - - -
- {children} -
-
-
- -
- - - ) -} diff --git a/app/not-found.tsx b/app/not-found.tsx deleted file mode 100644 index e3ec6da..0000000 --- a/app/not-found.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client" - -import Link from "next/link" -import { useRouter } from "next/navigation" -import { AlertTriangleIcon, ChevronLeftIcon, HouseIcon } from "lucide-react" - -import { Button, buttonVariants } from "@/components/ui/button" - -export default function NotFound() { - const router = useRouter() - return ( -
-
-

- -

-

- Page not found -

-

- The page you are looking for doesn't exist. -

-
- - - - Take me home - -
-
-
- ) -} diff --git a/components.json b/components.json deleted file mode 100644 index 444605f..0000000 --- a/components.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": true, - "tsx": true, - "tailwind": { - "config": "tailwind.config.ts", - "css": "app/globals.css", - "baseColor": "zinc", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - }, - "iconLibrary": "lucide" -} diff --git a/components/active-theme.tsx b/components/active-theme.tsx deleted file mode 100644 index 2cc5db8..0000000 --- a/components/active-theme.tsx +++ /dev/null @@ -1,90 +0,0 @@ -"use client" - -import { - createContext, - ReactNode, - useContext, - useEffect, - useState, -} from "react" - -const COOKIE_NAME = "active_theme" -const DEFAULT_THEME = "default" - -function setThemeCookie(theme: string) { - if (typeof window === "undefined") return - - document.cookie = `${COOKIE_NAME}=${theme}; path=/; max-age=31536000; SameSite=Lax; ${ - window.location.protocol === "https:" ? "Secure;" : "" - }` -} - -type ThemeContextType = { - activeTheme: string - setActiveTheme: (theme: string) => void -} - -const ThemeContext = createContext(undefined) - -export function ActiveThemeProvider({ children }: { children: ReactNode }) { - const [activeTheme, setActiveTheme] = useState(DEFAULT_THEME) - - useEffect(() => { - const cookie = document.cookie - .split("; ") - .find((row) => row.startsWith(`${COOKIE_NAME}=`)) - if (cookie) { - const cookieTheme = cookie.split("=")[1] - if (cookieTheme && cookieTheme !== activeTheme) { - setActiveTheme(cookieTheme) - } - } - // eslint-disable-next-line - }, []) - - useEffect(() => { - setThemeCookie(activeTheme) - - Array.from(document.body.classList) - .filter((className) => className.startsWith("theme-")) - .forEach((className) => { - document.body.classList.remove(className) - }) - - document.body.classList.add(`theme-${activeTheme}`) - if (activeTheme.endsWith("-scaled")) { - document.body.classList.add("theme-scaled") - } - }, [activeTheme]) - - return ( - -