diff --git a/amicons-docs/app/icons/page.tsx b/amicons-docs/app/icons/page.tsx new file mode 100644 index 00000000..b12a2680 --- /dev/null +++ b/amicons-docs/app/icons/page.tsx @@ -0,0 +1,7 @@ +export default function Icons() { + return ( +
+

All the icons

+
+ ); +} diff --git a/amicons-docs/app/layout.tsx b/amicons-docs/app/layout.tsx index f7fa87eb..edc945fd 100644 --- a/amicons-docs/app/layout.tsx +++ b/amicons-docs/app/layout.tsx @@ -1,20 +1,17 @@ import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; +import Link from "next/link"; +import Amicon, { aiAmicons, aiGithub } from "@studio384/amaranth"; +import { Lexend } from "next/font/google"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", +const lexend = Lexend({ + variable: "--font-lexend", subsets: ["latin"], }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "Amicons Next", + description: "A brand new Amicons documentation website.", }; export default function RootLayout({ @@ -24,9 +21,40 @@ export default function RootLayout({ }>) { return ( - + +
+
+
+

+ + Amicons +

+ +
+ + + GitHub + +
+
+
+
{children} diff --git a/amicons-docs/app/page.tsx b/amicons-docs/app/page.tsx index 9f2ff3fe..ca2822c6 100644 --- a/amicons-docs/app/page.tsx +++ b/amicons-docs/app/page.tsx @@ -1,3 +1,163 @@ +import Amicon, { aiAmicons, aiTriangleExclamation } from "@studio384/amaranth"; + export default function Home() { - return
Welcome to the next gen docs
; + return ( +
+
+
+
+

+ 450+ amicable icons for{" "} + your designs +

+
+ +
+
+
+
+
+
+
+
+
+ +

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+

Welcome to the next gen docs

+
+
+ ); } diff --git a/amicons-docs/package-lock.json b/amicons-docs/package-lock.json index 8920fcb4..f95e134e 100644 --- a/amicons-docs/package-lock.json +++ b/amicons-docs/package-lock.json @@ -8,6 +8,7 @@ "name": "amicons-docs", "version": "0.1.0", "dependencies": { + "@studio384/amaranth": "file:../amicons/", "next": "15.1.0", "react": "^19.0.0", "react-dom": "^19.0.0" @@ -25,6 +26,29 @@ "typescript": "^5" } }, + "../amicons": { + "name": "@studio384/amicons", + "version": "1.0.0-alpha.8", + "license": "AGPL-3.0-or-later", + "dependencies": { + "html-react-parser": "5.2.0" + }, + "devDependencies": { + "@types/react": "19.0.1", + "nodemon": "3.1.7", + "npm-run-all": "4.1.5", + "picocolors": "1.1.1", + "react": "19.0.0", + "react-dom": "19.0.0", + "svg-to-ts": "12.0.0", + "svgo": "3.3.2", + "typescript": "5.7.2" + }, + "peerDependencies": { + "@emotion/css": "^11.x", + "react": ">=16.x" + } + }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -808,6 +832,10 @@ "dev": true, "license": "MIT" }, + "node_modules/@studio384/amaranth": { + "resolved": "../amicons", + "link": true + }, "node_modules/@swc/counter": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", diff --git a/amicons-docs/package.json b/amicons-docs/package.json index 12d0c85b..48273917 100644 --- a/amicons-docs/package.json +++ b/amicons-docs/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "@studio384/amaranth": "file:../amicons/", "next": "15.1.0", "react": "^19.0.0", "react-dom": "^19.0.0" diff --git a/amicons-docs/public/file.svg b/amicons-docs/public/file.svg deleted file mode 100644 index 004145cd..00000000 --- a/amicons-docs/public/file.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/amicons-docs/public/globe.svg b/amicons-docs/public/globe.svg deleted file mode 100644 index 567f17b0..00000000 --- a/amicons-docs/public/globe.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/amicons-docs/public/next.svg b/amicons-docs/public/next.svg deleted file mode 100644 index 5174b28c..00000000 --- a/amicons-docs/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/amicons-docs/public/vercel.svg b/amicons-docs/public/vercel.svg deleted file mode 100644 index 77053960..00000000 --- a/amicons-docs/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/amicons-docs/public/window.svg b/amicons-docs/public/window.svg deleted file mode 100644 index b2b2a44f..00000000 --- a/amicons-docs/public/window.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/amicons/build/generate-library.js b/amicons/build/generate-library.js index ca4cc6c7..9015b644 100644 --- a/amicons/build/generate-library.js +++ b/amicons/build/generate-library.js @@ -1,117 +1,117 @@ -#!/usr/bin/env node - -"use strict"; - -const fs = require("fs").promises; -const fst = require("fs"); -const path = require("path"); -const picocolors = require("picocolors"); - -const iconsDir = path.join(__dirname, "../docs/public/data/icons"); -const pagesDir = path.join(__dirname, "../docs/src/data/"); - -function getReactImportName(string) { - return `ai${string - .split("-") - .map(word => { - return word[0].toUpperCase() + word.substring(1); - }) - .join("")}`; -} - -async function main(file) { - const iconFilePath = path.join(iconsDir, file); - const iconFile = fst.readFileSync(iconFilePath); - - let iconJson = {}; - - try { - iconJson = JSON.parse(iconFile); - } catch (e) { - console.log(iconFilePath); - } - - const iconBasename = path.basename(file, path.extname(file)); - const iconTitle = getReactImportName(iconBasename); - - const jsonTemplate = ` - { - component: '${iconTitle}', - categories: ${JSON.stringify(iconJson.categories)}, - tags: ${JSON.stringify(iconJson.tags)}, - slug: '${iconBasename}', - icon: ${iconTitle} - }`; - - return [`${iconTitle}`, jsonTemplate, iconJson.categories]; -} - -(async () => { - try { - const timeLabel = picocolors.cyan(`Library generation finished`); - - console.log(picocolors.cyan(`Library generation started`)); - console.time(timeLabel); - - const files = await fs.readdir(iconsDir); - - const names = []; - const configs = []; - let categories = new Set(); - - // Read content from each icon - await Promise.all( - files.map(async file => { - const [name, config, cats] = await Promise.resolve(main(file)); - - names.push(name); - configs.push(config); - - cats.map(cat => { - categories.add(cat); - }); - }) - ); - - categories = Array.from(categories).sort(); - - const library = ` -import { ${names.map(icon => `${icon}`)} } from '@studio384/amaranth'; - -const icons = [${configs.map(page => `${page}`)} -]; - -export default icons;`; - - await fs.writeFile(path.join(pagesDir, `icons.ts`), library); - - const categoriesTemplate = ` -import { aiCircleDashed } from '@studio384/amaranth'; - -const categories = [${categories.map( - cat => ` - { - slug: "${cat}", - title: "${cat}", - icon: aiCircleDashed - }` - )} -]; - -export default categories;`; - - // await fs.writeFile(path.join(pagesDir, `categories.ts`), categoriesTemplate) - - const filesLength = files.length; - - console.log( - picocolors.green("\nSuccess, %s icon%s written to library!"), - filesLength, - filesLength !== 1 ? "s" : "" - ); - console.timeEnd(timeLabel); - } catch (error) { - console.error(error); - process.exit(1); - } -})(); +#!/usr/bin/env node + +"use strict"; + +const fs = require("fs").promises; +const fst = require("fs"); +const path = require("path"); +const picocolors = require("picocolors"); + +const iconsDir = path.join(__dirname, "../docs/public/data/icons"); +const pagesDir = path.join(__dirname, "../docs/src/data/"); + +function getReactImportName(string) { + return `ai${string + .split("-") + .map((word) => { + return word[0].toUpperCase() + word.substring(1); + }) + .join("")}`; +} + +async function main(file) { + const iconFilePath = path.join(iconsDir, file); + const iconFile = fst.readFileSync(iconFilePath); + + let iconJson = {}; + + try { + iconJson = JSON.parse(iconFile); + } catch (e) { + console.log(iconFilePath); + } + + const iconBasename = path.basename(file, path.extname(file)); + const iconTitle = getReactImportName(iconBasename); + + const jsonTemplate = ` + { + component: '${iconTitle}', + categories: ${JSON.stringify(iconJson.categories)}, + tags: ${JSON.stringify(iconJson.tags)}, + slug: '${iconBasename}', + icon: ${iconTitle} + }`; + + return [`${iconTitle}`, jsonTemplate, iconJson.categories]; +} + +(async () => { + try { + const timeLabel = picocolors.cyan(`Library generation finished`); + + console.log(picocolors.cyan(`Library generation started`)); + console.time(timeLabel); + + const files = await fs.readdir(iconsDir); + + const names = []; + const configs = []; + let categories = new Set(); + + // Read content from each icon + await Promise.all( + files.map(async (file) => { + const [name, config, cats] = await Promise.resolve(main(file)); + + names.push(name); + configs.push(config); + + cats.map((cat) => { + categories.add(cat); + }); + }), + ); + + categories = Array.from(categories).sort(); + + const library = ` +import { ${names.map((icon) => `${icon}`)} } from '@studio384/amaranth'; + +const icons = [${configs.map((page) => `${page}`)} +]; + +export default icons;`; + + await fs.writeFile(path.join(pagesDir, `icons.ts`), library); + + const categoriesTemplate = ` +import { aiCircleDashed } from '@studio384/amaranth'; + +const categories = [${categories.map( + (cat) => ` + { + slug: "${cat}", + title: "${cat}", + icon: aiCircleDashed + }`, + )} +]; + +export default categories;`; + + // await fs.writeFile(path.join(pagesDir, `categories.ts`), categoriesTemplate) + + const filesLength = files.length; + + console.log( + picocolors.green("\nSuccess, %s icon%s written to library!"), + filesLength, + filesLength !== 1 ? "s" : "", + ); + console.timeEnd(timeLabel); + } catch (error) { + console.error(error); + process.exit(1); + } +})();