diff --git a/apps/docs/.eslintrc.js b/apps/docs/.eslintrc.js deleted file mode 100644 index 822111e..0000000 --- a/apps/docs/.eslintrc.js +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - project: true, - }, -}; diff --git a/apps/docs/.gitignore b/apps/docs/.gitignore index f41d5ce..55a12ae 100644 --- a/apps/docs/.gitignore +++ b/apps/docs/.gitignore @@ -1,68 +1,28 @@ -# Logs -logs -*.log +# deps +/node_modules + +# generated content +.contentlayer +.content-collections +.source + +# test & build +/coverage +/.next/ +/out/ +/build +*.tsbuildinfo + +# misc +.DS_Store +*.pem +/.pnp +.pnp.js npm-debug.log* yarn-debug.log* yarn-error.log* -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# dotenv environment variable files -.env* - -# Mac files -.DS_Store - -# Next.js build output -.next - -# Yarn -yarn-error.log -.pnp/ -.pnp.js -# Yarn Integrity file -.yarn-integrity +# others +.env*.local +.vercel +next-env.d.ts \ No newline at end of file diff --git a/apps/docs/.prettierignore b/apps/docs/.prettierignore deleted file mode 100644 index 8acd438..0000000 --- a/apps/docs/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -dist -package-lock.json -*.d.ts \ No newline at end of file diff --git a/apps/docs/.prettierrc.json b/apps/docs/.prettierrc.json deleted file mode 100644 index 5ab348b..0000000 --- a/apps/docs/.prettierrc.json +++ /dev/null @@ -1 +0,0 @@ -"@groovy-box/prettier" \ No newline at end of file diff --git a/apps/docs/LICENSE b/apps/docs/LICENSE deleted file mode 100644 index 7e964c1..0000000 --- a/apps/docs/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -The BSD Zero Clause License (0BSD) - -Copyright (c) 2020 Gatsby Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. diff --git a/apps/docs/README.md b/apps/docs/README.md index 74f5556..dd12f47 100644 --- a/apps/docs/README.md +++ b/apps/docs/README.md @@ -1,99 +1,26 @@ - -

- - Gatsby - -

-

- Gatsby's hello-world starter -

+# docs -Kick off your project with this hello-world boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React. +This is a Next.js application generated with +[Create Fumadocs](https://github.com/fuma-nama/fumadocs). -_Have another more specific idea? You may want to check out our vibrant collection of [official and community-created starters](https://www.gatsbyjs.com/docs/gatsby-starters/)._ +Run development server: -## πŸš€ Quick start +```bash +npm run dev +# or +pnpm dev +# or +yarn dev +``` -1. **Create a Gatsby site.** +Open http://localhost:3000 with your browser to see the result. - Use the Gatsby CLI ([install instructions](https://www.gatsbyjs.com/docs/tutorial/getting-started/part-0/#gatsby-cli)) to create a new site, specifying the hello-world starter. +## Learn More - ```shell - # create a new Gatsby site using the hello-world starter - gatsby new my-hello-world-starter https://github.com/gatsbyjs/gatsby-starter-hello-world - ``` +To learn more about Next.js and Fumadocs, take a look at the following +resources: -1. **Start developing.** - - Navigate into your new site’s directory and start it up. - - ```shell - cd my-hello-world-starter/ - gatsby develop - ``` - -1. **Open the source code and start editing!** - - Your site is now running at `http://localhost:8000`! - - Note: You'll also see a second link: `http://localhost:8000/___graphql`. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby Tutorial](https://www.gatsbyjs.com/docs/tutorial/getting-started/part-4/#use-graphiql-to-explore-the-data-layer-and-write-graphql-queries). - - Open the `my-hello-world-starter` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time! - -## πŸš€ Quick start (Netlify) - -Deploy this starter with one click on [Netlify](https://app.netlify.com/signup): - -[Deploy to Netlify](https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-hello-world) - -## 🧐 What's inside? - -A quick look at the top-level files and directories you'll see in a typical Gatsby project. - - . - β”œβ”€β”€ node_modules - β”œβ”€β”€ src - β”œβ”€β”€ .gitignore - β”œβ”€β”€ gatsby-browser.js - β”œβ”€β”€ gatsby-config.js - β”œβ”€β”€ gatsby-node.js - β”œβ”€β”€ gatsby-ssr.js - β”œβ”€β”€ LICENSE - β”œβ”€β”€ package.json - └── README.md - -1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed. - -1. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. `src` is a convention for β€œsource code”. - -1. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for. - -1. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/) (if any). These allow customization/extension of default Gatsby settings affecting the browser. - -1. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-config/) for more detail). - -1. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. - -1. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/) (if any). These allow customization of default Gatsby settings affecting server-side rendering. - -1. **`LICENSE`**: This Gatsby starter is licensed under the 0BSD license. This means that you can see this file as a placeholder and replace it with your own license. - -1. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project. - -1. **`README.md`**: A text file containing useful reference information about your project. - -## πŸŽ“ Learning Gatsby - -Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.com/). Here are some places to start: - -- **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.com/docs/tutorial/getting-started/).** It starts with zero assumptions about your level of ability and walks through every step of the process. - -- **To dive straight into code samples, head [to our documentation](https://www.gatsbyjs.com/docs/).** In particular, check out the _Guides_, _API Reference_, and _Advanced Tutorials_ sections in the sidebar. - -## πŸ’« Deploy - -[Build, Deploy, and Host On Netlify](https://netlify.com) - -The fastest way to combine your favorite tools and APIs to build the fastest sites, stores, and apps for the web. And also the best place to build, deploy, and host your Gatsby sites. - - +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js + features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs diff --git a/apps/docs/app/components/Access.tsx b/apps/docs/app/(home)/components/Access.tsx similarity index 53% rename from apps/docs/app/components/Access.tsx rename to apps/docs/app/(home)/components/Access.tsx index f290ecb..8b98aff 100644 --- a/apps/docs/app/components/Access.tsx +++ b/apps/docs/app/(home)/components/Access.tsx @@ -13,20 +13,20 @@ const Access = () => { }} > - + - + ); diff --git a/apps/docs/app/components/InstallPage.tsx b/apps/docs/app/(home)/components/InstallPage.tsx similarity index 78% rename from apps/docs/app/components/InstallPage.tsx rename to apps/docs/app/(home)/components/InstallPage.tsx index 8485161..0c5761f 100644 --- a/apps/docs/app/components/InstallPage.tsx +++ b/apps/docs/app/(home)/components/InstallPage.tsx @@ -2,14 +2,14 @@ import React from 'react'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { atomDark } from 'react-syntax-highlighter/dist/esm/styles/prism'; -import Wrapper from '../layout/Wrapper'; +import Wrapper from './Wrapper'; const InstallPage = () => { const codeString = `npm i @groovy-box/ui`; return ( - + {codeString} diff --git a/apps/docs/app/(home)/components/Wrapper.js b/apps/docs/app/(home)/components/Wrapper.js new file mode 100644 index 0000000..5209eb1 --- /dev/null +++ b/apps/docs/app/(home)/components/Wrapper.js @@ -0,0 +1,58 @@ +import React from 'react'; +import { Copy, Check } from 'lucide-react'; +import { useEffect, useState } from 'react'; + +const Wrapper = ({ children }) => { + const textToCopy = 'npm install gitemo-cli -g'; + + const [copySuccess, setCopySuccess] = React.useState(''); + + const copyToClipboard = () => { + navigator.clipboard.writeText(textToCopy).then( + () => { + setCopySuccess('Copied!'); + }, + (err) => { + setCopySuccess('Failed to copy!'); + console.error('Failed to copy text: ', err); + }, + ); + }; + + useEffect(() => { + const timeout = setTimeout(() => { + setCopySuccess(''); + }, 4000); + return () => clearTimeout(timeout); + }, [copySuccess]); + + return ( +
+ {React.cloneElement(children)} + +
+ ); +}; + +export default Wrapper; diff --git a/apps/docs/app/(home)/layout.tsx b/apps/docs/app/(home)/layout.tsx new file mode 100644 index 0000000..5ce4801 --- /dev/null +++ b/apps/docs/app/(home)/layout.tsx @@ -0,0 +1,11 @@ +import type { ReactNode } from 'react'; +import { HomeLayout } from 'fumadocs-ui/home-layout'; +import { baseOptions } from '../layout.config'; + +export default function Layout({ + children, +}: { + children: ReactNode; +}): React.ReactElement { + return {children}; +} diff --git a/apps/docs/app/page.tsx b/apps/docs/app/(home)/page.tsx similarity index 79% rename from apps/docs/app/page.tsx rename to apps/docs/app/(home)/page.tsx index 881c877..3ff45ba 100644 --- a/apps/docs/app/page.tsx +++ b/apps/docs/app/(home)/page.tsx @@ -1,14 +1,13 @@ -import InstallPage from '@components/InstallPage'; -import Access from '@components/Access'; +import Link from 'next/link'; +import InstallPage from './components/InstallPage'; +import Access from './components/Access'; -export default function Home() { +export default function HomePage() { return ( -
+
-

+

Beautifully crafted components for your next big front-end application.

({ + title: page.data.title, + description: page.data.description, + structuredData: page.data.structuredData, + id: page.url, + url: page.url, + })), +}); diff --git a/apps/docs/app/components/Demo.tsx b/apps/docs/app/components/Demo.tsx deleted file mode 100644 index 13e118e..0000000 --- a/apps/docs/app/components/Demo.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; - -const InstallPage = ({ data }: any) => { - console.log(data); - if (!data || !data.markdownRemark) { - return ( -
-
-          npm i enigma-ui-kit
-        
-
- ); - } - const { markdownRemark } = data; - const { html } = markdownRemark; - - return ( -
-
-
- ); -}; - -export default InstallPage; diff --git a/apps/docs/app/docs/[[...slug]]/page.tsx b/apps/docs/app/docs/[[...slug]]/page.tsx new file mode 100644 index 0000000..d299bd5 --- /dev/null +++ b/apps/docs/app/docs/[[...slug]]/page.tsx @@ -0,0 +1,45 @@ +import { source } from '@/app/source'; +import type { Metadata } from 'next'; +import { + DocsPage, + DocsBody, + DocsDescription, + DocsTitle, +} from 'fumadocs-ui/page'; +import { notFound } from 'next/navigation'; +import defaultMdxComponents from 'fumadocs-ui/mdx'; + +export default async function Page({ + params, +}: { + params: { slug?: string[] }; +}) { + const page = source.getPage(params.slug); + if (!page) notFound(); + + const MDX = page.data.body; + + return ( + + {page.data.title} + {page.data.description} + + + + + ); +} + +export async function generateStaticParams() { + return source.generateParams(); +} + +export function generateMetadata({ params }: { params: { slug?: string[] } }) { + const page = source.getPage(params.slug); + if (!page) notFound(); + + return { + title: page.data.title, + description: page.data.description, + } satisfies Metadata; +} diff --git a/apps/docs/app/docs/layout.tsx b/apps/docs/app/docs/layout.tsx new file mode 100644 index 0000000..4e011d5 --- /dev/null +++ b/apps/docs/app/docs/layout.tsx @@ -0,0 +1,12 @@ +import { DocsLayout } from 'fumadocs-ui/layout'; +import type { ReactNode } from 'react'; +import { baseOptions } from '../layout.config'; +import { source } from '@/app/source'; + +export default function Layout({ children }: { children: ReactNode }) { + return ( + + {children} + + ); +} diff --git a/apps/docs/app/global.css b/apps/docs/app/global.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/apps/docs/app/global.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/apps/docs/app/globals.css b/apps/docs/app/globals.css deleted file mode 100644 index 03aeeee..0000000 --- a/apps/docs/app/globals.css +++ /dev/null @@ -1,108 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -:root { - --appPrimaryColor: #25ae24; - --appSecondaryColor: #a2af9f; - - --appTextPrimaryColor: #ffffff; - --appTextSecondaryColor: #555a53; - - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 214, 219, 220; - --background-end-rgb: 255, 255, 255; -} - -@layer utilities { - .text-balance { - text-wrap: balance; - } -} - -@layer base { - :root { - --background: 0 0% 100%; - --foreground: 222.2 84% 4.9%; - - --card: 0 0% 100%; - --card-foreground: 222.2 84% 4.9%; - - --popover: 0 0% 100%; - --popover-foreground: 222.2 84% 4.9%; - - --primary: 222.2 47.4% 11.2%; - --primary-foreground: 210 40% 98%; - - --secondary: 210 40% 96.1%; - --secondary-foreground: 222.2 47.4% 11.2%; - - --muted: 210 40% 96.1%; - --muted-foreground: 215.4 16.3% 46.9%; - - --accent: 210 40% 96.1%; - --accent-foreground: 222.2 47.4% 11.2%; - - --destructive: 0 84.2% 60.2%; - --destructive-foreground: 210 40% 98%; - - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - --ring: 222.2 84% 4.9%; - - --radius: 0.5rem; - } - - .dark { - --background: 222.2 84% 4.9%; - --foreground: 210 40% 98%; - - --card: 222.2 84% 4.9%; - --card-foreground: 210 40% 98%; - - --popover: 222.2 84% 4.9%; - --popover-foreground: 210 40% 98%; - - --primary: 210 40% 98%; - --primary-foreground: 222.2 47.4% 11.2%; - - --secondary: 217.2 32.6% 17.5%; - --secondary-foreground: 210 40% 98%; - - --muted: 217.2 32.6% 17.5%; - --muted-foreground: 215 20.2% 65.1%; - - --accent: 217.2 32.6% 17.5%; - --accent-foreground: 210 40% 98%; - - --destructive: 0 62.8% 30.6%; - --destructive-foreground: 210 40% 98%; - - --border: 217.2 32.6% 17.5%; - --input: 217.2 32.6% 17.5%; - --ring: 212.7 26.8% 83.9%; - } -} - -@layer base { - * { - @apply border-border; - } - body { - @apply bg-background text-foreground; - } -} - -.access { - transition: all 0.4s ease-in-out; -} - -* { - margin: 0; - padding: 0; -} - -.access:hover { - color: #881fff; - text-decoration: underline; -} diff --git a/apps/docs/app/layout.config.tsx b/apps/docs/app/layout.config.tsx new file mode 100644 index 0000000..b995731 --- /dev/null +++ b/apps/docs/app/layout.config.tsx @@ -0,0 +1,38 @@ +import { type HomeLayoutProps } from 'fumadocs-ui/home-layout'; +import Image from 'next/image'; + +/** + * Shared layout configurations + * + * you can configure layouts individually from: + * Home Layout: app/(home)/layout.tsx + * Docs Layout: app/docs/layout.tsx + */ +export const baseOptions: HomeLayoutProps = { + nav: { + title: ( +
+ G +

Groovy-box

+
+ ), + }, + links: [ + { + text: 'docs', + url: '/docs', + active: 'nested-url', + }, + { + text: 'storybook', + url: 'https://groovy-box.netlify.app/?path=/docs/components-button--docs', + active: 'nested-url', + }, + ], +}; diff --git a/apps/docs/app/layout.tsx b/apps/docs/app/layout.tsx index e51fa28..dc3c67b 100644 --- a/apps/docs/app/layout.tsx +++ b/apps/docs/app/layout.tsx @@ -1,24 +1,17 @@ -import type { Metadata } from 'next'; +import './global.css'; +import { RootProvider } from 'fumadocs-ui/provider'; import { Inter } from 'next/font/google'; -import './globals.css'; -import ParentLayout from '@layouts/Rootlayout'; +import type { ReactNode } from 'react'; -const inter = Inter({ subsets: ['latin'] }); +const inter = Inter({ + subsets: ['latin'], +}); -export const metadata: Metadata = { - title: 'Groovy-Box', - description: 'My conmponent library', -}; - -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { +export default function Layout({ children }: { children: ReactNode }) { return ( - - - {children} + + + {children} ); diff --git a/apps/docs/app/layout/Footer.tsx b/apps/docs/app/layout/Footer.tsx deleted file mode 100644 index 86e4233..0000000 --- a/apps/docs/app/layout/Footer.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; - -export default function Footer() { - let currentYear = new Date().getFullYear(); - return ( -
-
-

- Groovy-Box Β© {currentYear} -

-
-
- ); -} diff --git a/apps/docs/app/layout/Header.tsx b/apps/docs/app/layout/Header.tsx deleted file mode 100644 index c260816..0000000 --- a/apps/docs/app/layout/Header.tsx +++ /dev/null @@ -1,183 +0,0 @@ -import React, { ReactNode } from 'react'; -import { cn } from '../lib/utils'; -import * as styles from './layout.module.css'; -import { - NavigationMenu, - NavigationMenuContent, - NavigationMenuItem, - NavigationMenuLink, - NavigationMenuList, - NavigationMenuTrigger, -} from '../utility/ui/navigation-menu'; - -const components = [ - { - title: 'Button', - href: 'https://groovy-box.netlify.app/?path=/docs/components-button--docs', - description: - 'A basic button component that should render nicely on any platform', - }, - { - title: 'Textfield', - href: 'https://groovy-box.netlify.app/?path=/docs/components-textfield--docs', - description: - 'Customizable TextField to tailor your input fields with ease for enhanced user experiences', - }, -]; - -export default function Header() { - return ( -
-
-
- -
- -
- - {/*
- - Components - - - Docs - - - About - -
*/} - - - - Classics - -
    - {components.map((component) => ( - - {component.description} - - ))} -
-
-
- - Components - - - - -
-
-
-
- ); -} - -interface ListItemProps { - newTab?: boolean; - children: ReactNode; -} - -type ListItemCombinedProps = ListItemProps & - React.ComponentPropsWithoutRef<'a'>; - -const ListItem = React.forwardRef, ListItemCombinedProps>( - function ( - { className, title, newTab = false, children, href, ...props }, - ref - ) { - return ( -
  • - - -
    {title}
    -

    - {children} -

    -
    -
    -
  • - ); - } -); - -ListItem.displayName = 'ListItem'; diff --git a/apps/docs/app/layout/Rootlayout.tsx b/apps/docs/app/layout/Rootlayout.tsx deleted file mode 100644 index 6f77399..0000000 --- a/apps/docs/app/layout/Rootlayout.tsx +++ /dev/null @@ -1,18 +0,0 @@ -'use client'; -import React from 'react'; -import Header from './Header'; -import Footer from './Footer'; - -interface ParentLayoutProps { - children: React.ReactNode; -} - -export default function ParentLayout({ children }: ParentLayoutProps) { - return ( - <> -
    - {children} -