From f254b92bd336599abf6bd04d17d6c4c82e7eb538 Mon Sep 17 00:00:00 2001 From: Ronan Berder Date: Sat, 27 Jun 2026 09:01:35 +0800 Subject: [PATCH] Checkpoint repo restructure --- package.json | 125 +++++++++-- packages/css/README.md | 81 ------- packages/css/package.json | 124 ----------- astro.config.mjs => site/astro.config.mjs | 0 .../public}/assets/apple-touch-icon.png | Bin {public => site/public}/assets/favicon.svg | 0 .../geist/geist-mono-latin-400-normal.woff2 | Bin .../geist/geist-mono-latin-500-normal.woff2 | Bin .../geist/geist-mono-latin-600-normal.woff2 | Bin .../geist/geist-mono-latin-700-normal.woff2 | Bin .../geist/geist-sans-latin-400-normal.woff2 | Bin .../geist/geist-sans-latin-500-normal.woff2 | Bin .../geist/geist-sans-latin-600-normal.woff2 | Bin .../geist/geist-sans-latin-700-normal.woff2 | Bin .../public}/assets/images/avatar-1.png | Bin .../public}/assets/images/avatar-2.png | Bin .../public}/assets/images/avatar-3.png | Bin .../public}/assets/images/screenshot.png | Bin .../public}/assets/social-screenshot.png | Bin {public => site/public}/assets/social.png | Bin .../src/docs}/assets/styles/style-luma.css | 0 .../src/docs}/assets/styles/style-lyra.css | 0 .../src/docs}/assets/styles/style-maia.css | 0 .../src/docs}/assets/styles/style-mira.css | 0 .../src/docs}/assets/styles/style-nova.css | 0 .../src/docs}/assets/styles/style-rhea.css | 0 .../src/docs}/assets/styles/style-sera.css | 0 .../src/docs}/assets/styles/style-vega.css | 0 .../src/docs}/components/accordion.mdx | 0 .../src/docs}/components/alert-dialog.mdx | 0 .../src/docs}/components/alert.mdx | 0 .../src/docs}/components/avatar.mdx | 0 .../src/docs}/components/badge.mdx | 0 .../src/docs}/components/breadcrumb.mdx | 0 .../src/docs}/components/button-group.mdx | 0 .../src/docs}/components/button.mdx | 0 .../src => site/src/docs}/components/card.mdx | 0 .../src/docs}/components/chart.mdx | 0 .../src/docs}/components/checkbox.mdx | 0 .../src/docs}/components/combobox.mdx | 0 .../src/docs}/components/command.mdx | 0 .../src/docs}/components/dialog.mdx | 0 .../src/docs}/components/drawer.mdx | 0 .../src/docs}/components/dropdown-menu.mdx | 0 .../src/docs}/components/empty.mdx | 0 .../src/docs}/components/field.mdx | 0 .../src/docs}/components/input-group.mdx | 0 .../src/docs}/components/input.mdx | 0 .../src => site/src/docs}/components/item.mdx | 0 .../src => site/src/docs}/components/kbd.mdx | 0 .../src/docs}/components/label.mdx | 0 .../src/docs}/components/native-select.mdx | 0 .../src/docs}/components/pagination.mdx | 0 .../src/docs}/components/popover.mdx | 0 .../src/docs}/components/progress.mdx | 0 .../src/docs}/components/radio-group.mdx | 0 .../src/docs}/components/scroll-area.mdx | 0 .../src/docs}/components/select.mdx | 0 .../src/docs}/components/sidebar.mdx | 0 .../src/docs}/components/skeleton.mdx | 0 .../src/docs}/components/slider.mdx | 0 .../src/docs}/components/spinner.mdx | 0 .../src/docs}/components/switch.mdx | 0 .../src/docs}/components/table.mdx | 0 .../src => site/src/docs}/components/tabs.mdx | 0 .../src/docs}/components/textarea.mdx | 0 .../src/docs}/components/theme-switcher.mdx | 0 .../src/docs}/components/toast.mdx | 0 .../src/docs}/components/tooltip.mdx | 0 {docs/src => site/src/docs}/customization.mdx | 0 {docs/src => site/src/docs}/docs.json | 0 .../src/docs}/fragments/toast/error.njk | 0 .../src/docs}/fragments/toast/info.njk | 0 .../src/docs}/fragments/toast/success.njk | 0 .../src/docs}/fragments/toast/warning.njk | 0 {docs/src => site/src/docs}/installation.mdx | 0 {docs/src => site/src/docs}/introduction.md | 0 .../src/docs}/site/ContentHeader.astro | 0 .../src/docs}/site/SidebarHeader.astro | 0 .../src/docs}/site/StyleHead.astro | 0 .../src/docs}/site/chart-examples.js | 0 .../src/docs}/site/demo-interactions.js | 0 {docs/src => site/src/docs}/templates.mdx | 0 .../src}/pages/fragments/toast/[type].ts | 0 {src => site/src}/pages/index.astro | 0 {src => site/src}/pages/robots.txt.ts | 0 {src => site/src}/pages/sitemap.xml.ts | 0 wrangler.jsonc => site/wrangler.jsonc | 0 src/jinja/combobox.html.jinja | 142 ------------ src/jinja/command.html.jinja | 203 ------------------ src/jinja/dialog.html.jinja | 92 -------- src/jinja/dropdown-menu.html.jinja | 124 ----------- src/jinja/popover.html.jinja | 48 ----- src/jinja/select.html.jinja | 183 ---------------- src/jinja/sidebar.html.jinja | 144 ------------- src/jinja/tabs.html.jinja | 80 ------- src/jinja/toast.html.jinja | 117 ---------- src/nunjucks/combobox.njk | 157 -------------- src/nunjucks/command.njk | 203 ------------------ src/nunjucks/dialog.njk | 92 -------- src/nunjucks/dropdown-menu.njk | 124 ----------- src/nunjucks/popover.njk | 48 ----- src/nunjucks/select.njk | 184 ---------------- src/nunjucks/sidebar.njk | 144 ------------- src/nunjucks/tabs.njk | 27 --- src/nunjucks/toast.njk | 117 ---------- .../templates/jinja/combobox.html.jinja | 0 .../templates/jinja/command.html.jinja | 0 .../templates/jinja/dialog.html.jinja | 0 .../templates/jinja/dropdown-menu.html.jinja | 0 .../templates/jinja/popover.html.jinja | 0 .../templates/jinja/select.html.jinja | 0 .../templates/jinja/sidebar.html.jinja | 0 .../templates/jinja/tabs.html.jinja | 0 .../templates/jinja/toast.html.jinja | 0 .../templates/nunjucks/combobox.njk | 0 .../templates/nunjucks/command.njk | 0 .../css => src}/templates/nunjucks/dialog.njk | 0 .../templates/nunjucks/dropdown-menu.njk | 0 .../templates/nunjucks/popover.njk | 0 .../css => src}/templates/nunjucks/select.njk | 0 .../templates/nunjucks/sidebar.njk | 0 .../css => src}/templates/nunjucks/tabs.njk | 0 .../css => src}/templates/nunjucks/toast.njk | 0 124 files changed, 104 insertions(+), 2455 deletions(-) delete mode 100644 packages/css/README.md delete mode 100644 packages/css/package.json rename astro.config.mjs => site/astro.config.mjs (100%) rename {public => site/public}/assets/apple-touch-icon.png (100%) rename {public => site/public}/assets/favicon.svg (100%) rename {public => site/public}/assets/fonts/geist/geist-mono-latin-400-normal.woff2 (100%) rename {public => site/public}/assets/fonts/geist/geist-mono-latin-500-normal.woff2 (100%) rename {public => site/public}/assets/fonts/geist/geist-mono-latin-600-normal.woff2 (100%) rename {public => site/public}/assets/fonts/geist/geist-mono-latin-700-normal.woff2 (100%) rename {public => site/public}/assets/fonts/geist/geist-sans-latin-400-normal.woff2 (100%) rename {public => site/public}/assets/fonts/geist/geist-sans-latin-500-normal.woff2 (100%) rename {public => site/public}/assets/fonts/geist/geist-sans-latin-600-normal.woff2 (100%) rename {public => site/public}/assets/fonts/geist/geist-sans-latin-700-normal.woff2 (100%) rename {public => site/public}/assets/images/avatar-1.png (100%) rename {public => site/public}/assets/images/avatar-2.png (100%) rename {public => site/public}/assets/images/avatar-3.png (100%) rename {public => site/public}/assets/images/screenshot.png (100%) rename {public => site/public}/assets/social-screenshot.png (100%) rename {public => site/public}/assets/social.png (100%) rename {docs/src => site/src/docs}/assets/styles/style-luma.css (100%) rename {docs/src => site/src/docs}/assets/styles/style-lyra.css (100%) rename {docs/src => site/src/docs}/assets/styles/style-maia.css (100%) rename {docs/src => site/src/docs}/assets/styles/style-mira.css (100%) rename {docs/src => site/src/docs}/assets/styles/style-nova.css (100%) rename {docs/src => site/src/docs}/assets/styles/style-rhea.css (100%) rename {docs/src => site/src/docs}/assets/styles/style-sera.css (100%) rename {docs/src => site/src/docs}/assets/styles/style-vega.css (100%) rename {docs/src => site/src/docs}/components/accordion.mdx (100%) rename {docs/src => site/src/docs}/components/alert-dialog.mdx (100%) rename {docs/src => site/src/docs}/components/alert.mdx (100%) rename {docs/src => site/src/docs}/components/avatar.mdx (100%) rename {docs/src => site/src/docs}/components/badge.mdx (100%) rename {docs/src => site/src/docs}/components/breadcrumb.mdx (100%) rename {docs/src => site/src/docs}/components/button-group.mdx (100%) rename {docs/src => site/src/docs}/components/button.mdx (100%) rename {docs/src => site/src/docs}/components/card.mdx (100%) rename {docs/src => site/src/docs}/components/chart.mdx (100%) rename {docs/src => site/src/docs}/components/checkbox.mdx (100%) rename {docs/src => site/src/docs}/components/combobox.mdx (100%) rename {docs/src => site/src/docs}/components/command.mdx (100%) rename {docs/src => site/src/docs}/components/dialog.mdx (100%) rename {docs/src => site/src/docs}/components/drawer.mdx (100%) rename {docs/src => site/src/docs}/components/dropdown-menu.mdx (100%) rename {docs/src => site/src/docs}/components/empty.mdx (100%) rename {docs/src => site/src/docs}/components/field.mdx (100%) rename {docs/src => site/src/docs}/components/input-group.mdx (100%) rename {docs/src => site/src/docs}/components/input.mdx (100%) rename {docs/src => site/src/docs}/components/item.mdx (100%) rename {docs/src => site/src/docs}/components/kbd.mdx (100%) rename {docs/src => site/src/docs}/components/label.mdx (100%) rename {docs/src => site/src/docs}/components/native-select.mdx (100%) rename {docs/src => site/src/docs}/components/pagination.mdx (100%) rename {docs/src => site/src/docs}/components/popover.mdx (100%) rename {docs/src => site/src/docs}/components/progress.mdx (100%) rename {docs/src => site/src/docs}/components/radio-group.mdx (100%) rename {docs/src => site/src/docs}/components/scroll-area.mdx (100%) rename {docs/src => site/src/docs}/components/select.mdx (100%) rename {docs/src => site/src/docs}/components/sidebar.mdx (100%) rename {docs/src => site/src/docs}/components/skeleton.mdx (100%) rename {docs/src => site/src/docs}/components/slider.mdx (100%) rename {docs/src => site/src/docs}/components/spinner.mdx (100%) rename {docs/src => site/src/docs}/components/switch.mdx (100%) rename {docs/src => site/src/docs}/components/table.mdx (100%) rename {docs/src => site/src/docs}/components/tabs.mdx (100%) rename {docs/src => site/src/docs}/components/textarea.mdx (100%) rename {docs/src => site/src/docs}/components/theme-switcher.mdx (100%) rename {docs/src => site/src/docs}/components/toast.mdx (100%) rename {docs/src => site/src/docs}/components/tooltip.mdx (100%) rename {docs/src => site/src/docs}/customization.mdx (100%) rename {docs/src => site/src/docs}/docs.json (100%) rename {docs/src => site/src/docs}/fragments/toast/error.njk (100%) rename {docs/src => site/src/docs}/fragments/toast/info.njk (100%) rename {docs/src => site/src/docs}/fragments/toast/success.njk (100%) rename {docs/src => site/src/docs}/fragments/toast/warning.njk (100%) rename {docs/src => site/src/docs}/installation.mdx (100%) rename {docs/src => site/src/docs}/introduction.md (100%) rename {docs/src => site/src/docs}/site/ContentHeader.astro (100%) rename {docs/src => site/src/docs}/site/SidebarHeader.astro (100%) rename {docs/src => site/src/docs}/site/StyleHead.astro (100%) rename {docs/src => site/src/docs}/site/chart-examples.js (100%) rename {docs/src => site/src/docs}/site/demo-interactions.js (100%) rename {docs/src => site/src/docs}/templates.mdx (100%) rename {src => site/src}/pages/fragments/toast/[type].ts (100%) rename {src => site/src}/pages/index.astro (100%) rename {src => site/src}/pages/robots.txt.ts (100%) rename {src => site/src}/pages/sitemap.xml.ts (100%) rename wrangler.jsonc => site/wrangler.jsonc (100%) delete mode 100644 src/jinja/combobox.html.jinja delete mode 100644 src/jinja/command.html.jinja delete mode 100644 src/jinja/dialog.html.jinja delete mode 100644 src/jinja/dropdown-menu.html.jinja delete mode 100644 src/jinja/popover.html.jinja delete mode 100644 src/jinja/select.html.jinja delete mode 100644 src/jinja/sidebar.html.jinja delete mode 100644 src/jinja/tabs.html.jinja delete mode 100644 src/jinja/toast.html.jinja delete mode 100644 src/nunjucks/combobox.njk delete mode 100644 src/nunjucks/command.njk delete mode 100644 src/nunjucks/dialog.njk delete mode 100644 src/nunjucks/dropdown-menu.njk delete mode 100644 src/nunjucks/popover.njk delete mode 100644 src/nunjucks/select.njk delete mode 100644 src/nunjucks/sidebar.njk delete mode 100644 src/nunjucks/tabs.njk delete mode 100644 src/nunjucks/toast.njk rename {packages/css => src}/templates/jinja/combobox.html.jinja (100%) rename {packages/css => src}/templates/jinja/command.html.jinja (100%) rename {packages/css => src}/templates/jinja/dialog.html.jinja (100%) rename {packages/css => src}/templates/jinja/dropdown-menu.html.jinja (100%) rename {packages/css => src}/templates/jinja/popover.html.jinja (100%) rename {packages/css => src}/templates/jinja/select.html.jinja (100%) rename {packages/css => src}/templates/jinja/sidebar.html.jinja (100%) rename {packages/css => src}/templates/jinja/tabs.html.jinja (100%) rename {packages/css => src}/templates/jinja/toast.html.jinja (100%) rename {packages/css => src}/templates/nunjucks/combobox.njk (100%) rename {packages/css => src}/templates/nunjucks/command.njk (100%) rename {packages/css => src}/templates/nunjucks/dialog.njk (100%) rename {packages/css => src}/templates/nunjucks/dropdown-menu.njk (100%) rename {packages/css => src}/templates/nunjucks/popover.njk (100%) rename {packages/css => src}/templates/nunjucks/select.njk (100%) rename {packages/css => src}/templates/nunjucks/sidebar.njk (100%) rename {packages/css => src}/templates/nunjucks/tabs.njk (100%) rename {packages/css => src}/templates/nunjucks/toast.njk (100%) diff --git a/package.json b/package.json index e59ee30..82337ed 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,21 @@ { - "name": "basecoat", + "name": "basecoat-css", "version": "1.0.0", - "description": "shadcn/ui for the rest of us", - "author": "hunvreus", + "description": "Tailwind CSS for Basecoat components", + "author": { + "name": "hunvreus", + "url": "https://x.com/hunvreus" + }, + "license": "MIT", "type": "module", - "private": true, + "main": "dist/basecoat.css", + "style": "dist/basecoat.css", + "files": [ + "dist/", + "templates/" + ], "workspaces": [ - "packages/css" + "site" ], "keywords": [ "components", @@ -23,7 +32,6 @@ "jinja", "nunjucks" ], - "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/hunvreus/basecoat.git" @@ -31,27 +39,102 @@ "bugs": { "url": "https://github.com/hunvreus/basecoat/issues" }, - "homepage": "https://github.com/hunvreus/basecoat#readme", + "homepage": "https://basecoatui.com/installation#npm", + "exports": { + ".": "./dist/basecoat.css", + "./css": "./dist/basecoat.css", + "./basecoat": "./dist/js/basecoat.js", + "./basecoat.min": "./dist/js/basecoat.min.js", + "./all": "./dist/js/all.js", + "./all.min": "./dist/js/all.min.js", + "./accordion": "./dist/js/accordion.js", + "./accordion.min": "./dist/js/accordion.min.js", + "./chart": "./dist/js/chart.js", + "./chart.min": "./dist/js/chart.min.js", + "./combobox": "./dist/js/combobox.js", + "./combobox.min": "./dist/js/combobox.min.js", + "./command": "./dist/js/command.js", + "./command.min": "./dist/js/command.min.js", + "./dropdown-menu": "./dist/js/dropdown-menu.js", + "./dropdown-menu.min": "./dist/js/dropdown-menu.min.js", + "./drawer": "./dist/js/drawer.js", + "./drawer.min": "./dist/js/drawer.min.js", + "./popover": "./dist/js/popover.js", + "./popover.min": "./dist/js/popover.min.js", + "./range": "./dist/js/range.js", + "./range.min": "./dist/js/range.min.js", + "./select": "./dist/js/select.js", + "./select.min": "./dist/js/select.min.js", + "./sidebar": "./dist/js/sidebar.js", + "./sidebar.min": "./dist/js/sidebar.min.js", + "./tabs": "./dist/js/tabs.js", + "./tabs.min": "./dist/js/tabs.min.js", + "./toast": "./dist/js/toast.js", + "./toast.min": "./dist/js/toast.min.js", + "./all.css": "./dist/basecoat.all.css", + "./base": "./dist/basecoat-base.css", + "./base.css": "./dist/basecoat-base.css", + "./base.cdn.css": "./dist/basecoat-base.cdn.css", + "./compat": "./dist/basecoat-compat.css", + "./compat.css": "./dist/basecoat-compat.css", + "./compat.cdn.css": "./dist/basecoat-compat.cdn.css", + "./compat/legacy.css": "./dist/compat/legacy.css", + "./components": "./dist/basecoat-components.css", + "./components.css": "./dist/basecoat-components.css", + "./components/*": "./dist/components/*.css", + "./components/*.css": "./dist/components/*.css", + "./base/base.css": "./dist/base/base.css", + "./vega": "./dist/basecoat-vega.css", + "./vega.css": "./dist/basecoat-vega.css", + "./nova": "./dist/basecoat-nova.css", + "./nova.css": "./dist/basecoat-nova.css", + "./maia": "./dist/basecoat-maia.css", + "./maia.css": "./dist/basecoat-maia.css", + "./lyra": "./dist/basecoat-lyra.css", + "./lyra.css": "./dist/basecoat-lyra.css", + "./mira": "./dist/basecoat-mira.css", + "./mira.css": "./dist/basecoat-mira.css", + "./luma": "./dist/basecoat-luma.css", + "./luma.css": "./dist/basecoat-luma.css", + "./sera": "./dist/basecoat-sera.css", + "./sera.css": "./dist/basecoat-sera.css", + "./rhea": "./dist/basecoat-rhea.css", + "./rhea.css": "./dist/basecoat-rhea.css", + "./styles/vega": "./dist/styles/vega.css", + "./styles/nova": "./dist/styles/nova.css", + "./styles/maia": "./dist/styles/maia.css", + "./styles/lyra": "./dist/styles/lyra.css", + "./styles/mira": "./dist/styles/mira.css", + "./styles/luma": "./dist/styles/luma.css", + "./styles/sera": "./dist/styles/sera.css", + "./styles/rhea": "./dist/styles/rhea.css", + "./styles/*": "./dist/styles/*.css", + "./styles/*.css": "./dist/styles/*.css", + "./package.json": "./package.json", + "./styles/style-vega.css": "./dist/styles/vega.css", + "./styles/style-nova.css": "./dist/styles/nova.css", + "./styles/style-maia.css": "./dist/styles/maia.css", + "./styles/style-lyra.css": "./dist/styles/lyra.css", + "./styles/style-mira.css": "./dist/styles/mira.css", + "./styles/style-luma.css": "./dist/styles/luma.css", + "./styles/style-sera.css": "./dist/styles/sera.css", + "./styles/style-rhea.css": "./dist/styles/rhea.css", + "./styles/style-*.css": "./dist/styles/*.css", + "./templates/nunjucks/*": "./templates/nunjucks/*", + "./templates/jinja/*": "./templates/jinja/*" + }, "scripts": { "build": "node ./scripts/build.js", - "docs:build": "npm run build && astro build", - "docs:dev": "astro dev", - "workers:dev": "npm run docs:build && wrangler dev", - "workers:deploy": "npm run docs:build && wrangler deploy", - "workers:preview": "npm run docs:build && wrangler versions upload" + "docs:build": "npm run build && npm run build --workspace site", + "docs:dev": "npm run dev --workspace site", + "workers:dev": "npm run build && npm run workers:dev --workspace site", + "workers:deploy": "npm run build && npm run workers:deploy --workspace site", + "workers:preview": "npm run build && npm run workers:preview --workspace site" }, "devDependencies": { - "@fontsource/geist-mono": "^5.2.8", - "@fontsource/geist-sans": "^5.2.5", "@tailwindcss/cli": "^4.1.17", - "astro": "^6.4.6", - "htmx.org": "^2.0.10", - "lucide-static": "^1.17.0", - "nunjucks": "^3.2.4", "prettier": "^3.5.3", - "reallysimpledocs": "^1.0.5", "tailwindcss": "^4.1.17", - "terser": "^5.42.0", - "wrangler": "^4.50.0" + "terser": "^5.42.0" } } diff --git a/packages/css/README.md b/packages/css/README.md deleted file mode 100644 index 81407fa..0000000 --- a/packages/css/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# basecoat-css - -This package provides CSS, JavaScript helpers, and optional Nunjucks/Jinja templates for [Basecoat](https://basecoatui.com). - -## Prerequisites - -Your project must have [Tailwind CSS](https://tailwindcss.com/docs/installation) installed and configured, as Basecoat relies on Tailwind utility classes and theming. - -## Installation - -Install with any package manager: - -```bash -npm install basecoat-css # or pnpm add / yarn add / bun add -``` - -## Usage - -Add it just after Tailwind in your stylesheet: - -```css -@import "tailwindcss"; -@import "basecoat-css"; -``` - -That's it, you can use any Basecoat class (`btn`, `card`, `input`, etc) in your markup. - -To use a specific style, import its standalone bundle instead: - -```css -@import "tailwindcss"; -@import "basecoat-css/sera"; -``` - -### (Optional) JavaScript - -Some interactive components need JavaScript. Import all component scripts, or cherry-pick only the entrypoints you use. - -With a build tool (ESM): - -```js -import 'basecoat-css/all'; -``` - -Or cherry-pick the components you need: - -```js -import 'basecoat-css/tabs'; -import 'basecoat-css/popover'; -``` - -Without a build tool, copy the files from `node_modules`: - -```bash -npx copyfiles -u 1 "node_modules/basecoat-css/dist/js/**/*" public/js/basecoat -``` - -Then reference what you need, e.g. - -```html - -``` - -### (Optional) Templates - -Nunjucks and Jinja templates ship with the package. Copy the template folder for your engine into your app: - -```bash -cp -R node_modules/basecoat-css/templates/nunjucks ./templates/basecoat -cp -R node_modules/basecoat-css/templates/jinja ./templates/basecoat -``` - -Templates are meant to be copied into your app and customized. - -## Documentation - -For more detailed information on components, their usage, and customization options, see the [Basecoat documentation](https://basecoatui.com/installation). - -## License - -[MIT](https://github.com/hunvreus/basecoat/blob/main/LICENSE.md) diff --git a/packages/css/package.json b/packages/css/package.json deleted file mode 100644 index 0af0de7..0000000 --- a/packages/css/package.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "name": "basecoat-css", - "version": "1.0.0", - "description": "Tailwind CSS for Basecoat components", - "author": { - "name": "hunvreus", - "url": "https://x.com/hunvreus" - }, - "license": "MIT", - "type": "module", - "main": "dist/basecoat.css", - "style": "dist/basecoat.css", - "files": [ - "dist/", - "templates/" - ], - "keywords": [ - "components", - "component library", - "component system", - "ui", - "ui kit", - "shadcn", - "shadcn/ui", - "tailwind", - "tailwindcss", - "css", - "html", - "jinja", - "nunjucks" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/hunvreus/basecoat.git", - "directory": "packages/css" - }, - "bugs": { - "url": "https://github.com/hunvreus/basecoat/issues" - }, - "homepage": "https://basecoatui.com/installation#npm", - "exports": { - ".": "./dist/basecoat.css", - "./css": "./dist/basecoat.css", - "./basecoat": "./dist/js/basecoat.js", - "./basecoat.min": "./dist/js/basecoat.min.js", - "./all": "./dist/js/all.js", - "./all.min": "./dist/js/all.min.js", - "./accordion": "./dist/js/accordion.js", - "./accordion.min": "./dist/js/accordion.min.js", - "./chart": "./dist/js/chart.js", - "./chart.min": "./dist/js/chart.min.js", - "./combobox": "./dist/js/combobox.js", - "./combobox.min": "./dist/js/combobox.min.js", - "./command": "./dist/js/command.js", - "./command.min": "./dist/js/command.min.js", - "./dropdown-menu": "./dist/js/dropdown-menu.js", - "./dropdown-menu.min": "./dist/js/dropdown-menu.min.js", - "./drawer": "./dist/js/drawer.js", - "./drawer.min": "./dist/js/drawer.min.js", - "./popover": "./dist/js/popover.js", - "./popover.min": "./dist/js/popover.min.js", - "./range": "./dist/js/range.js", - "./range.min": "./dist/js/range.min.js", - "./select": "./dist/js/select.js", - "./select.min": "./dist/js/select.min.js", - "./sidebar": "./dist/js/sidebar.js", - "./sidebar.min": "./dist/js/sidebar.min.js", - "./tabs": "./dist/js/tabs.js", - "./tabs.min": "./dist/js/tabs.min.js", - "./toast": "./dist/js/toast.js", - "./toast.min": "./dist/js/toast.min.js", - "./all.css": "./dist/basecoat.all.css", - "./base": "./dist/basecoat-base.css", - "./base.css": "./dist/basecoat-base.css", - "./base.cdn.css": "./dist/basecoat-base.cdn.css", - "./compat": "./dist/basecoat-compat.css", - "./compat.css": "./dist/basecoat-compat.css", - "./compat.cdn.css": "./dist/basecoat-compat.cdn.css", - "./compat/legacy.css": "./dist/compat/legacy.css", - "./components": "./dist/basecoat-components.css", - "./components.css": "./dist/basecoat-components.css", - "./components/*": "./dist/components/*.css", - "./components/*.css": "./dist/components/*.css", - "./base/base.css": "./dist/base/base.css", - "./vega": "./dist/basecoat-vega.css", - "./vega.css": "./dist/basecoat-vega.css", - "./nova": "./dist/basecoat-nova.css", - "./nova.css": "./dist/basecoat-nova.css", - "./maia": "./dist/basecoat-maia.css", - "./maia.css": "./dist/basecoat-maia.css", - "./lyra": "./dist/basecoat-lyra.css", - "./lyra.css": "./dist/basecoat-lyra.css", - "./mira": "./dist/basecoat-mira.css", - "./mira.css": "./dist/basecoat-mira.css", - "./luma": "./dist/basecoat-luma.css", - "./luma.css": "./dist/basecoat-luma.css", - "./sera": "./dist/basecoat-sera.css", - "./sera.css": "./dist/basecoat-sera.css", - "./rhea": "./dist/basecoat-rhea.css", - "./rhea.css": "./dist/basecoat-rhea.css", - "./styles/vega": "./dist/styles/vega.css", - "./styles/nova": "./dist/styles/nova.css", - "./styles/maia": "./dist/styles/maia.css", - "./styles/lyra": "./dist/styles/lyra.css", - "./styles/mira": "./dist/styles/mira.css", - "./styles/luma": "./dist/styles/luma.css", - "./styles/sera": "./dist/styles/sera.css", - "./styles/rhea": "./dist/styles/rhea.css", - "./styles/*": "./dist/styles/*.css", - "./styles/*.css": "./dist/styles/*.css", - "./package.json": "./package.json", - "./styles/style-vega.css": "./dist/styles/vega.css", - "./styles/style-nova.css": "./dist/styles/nova.css", - "./styles/style-maia.css": "./dist/styles/maia.css", - "./styles/style-lyra.css": "./dist/styles/lyra.css", - "./styles/style-mira.css": "./dist/styles/mira.css", - "./styles/style-luma.css": "./dist/styles/luma.css", - "./styles/style-sera.css": "./dist/styles/sera.css", - "./styles/style-rhea.css": "./dist/styles/rhea.css", - "./styles/style-*.css": "./dist/styles/*.css", - "./templates/nunjucks/*": "./templates/nunjucks/*", - "./templates/jinja/*": "./templates/jinja/*" - } -} diff --git a/astro.config.mjs b/site/astro.config.mjs similarity index 100% rename from astro.config.mjs rename to site/astro.config.mjs diff --git a/public/assets/apple-touch-icon.png b/site/public/assets/apple-touch-icon.png similarity index 100% rename from public/assets/apple-touch-icon.png rename to site/public/assets/apple-touch-icon.png diff --git a/public/assets/favicon.svg b/site/public/assets/favicon.svg similarity index 100% rename from public/assets/favicon.svg rename to site/public/assets/favicon.svg diff --git a/public/assets/fonts/geist/geist-mono-latin-400-normal.woff2 b/site/public/assets/fonts/geist/geist-mono-latin-400-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-mono-latin-400-normal.woff2 rename to site/public/assets/fonts/geist/geist-mono-latin-400-normal.woff2 diff --git a/public/assets/fonts/geist/geist-mono-latin-500-normal.woff2 b/site/public/assets/fonts/geist/geist-mono-latin-500-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-mono-latin-500-normal.woff2 rename to site/public/assets/fonts/geist/geist-mono-latin-500-normal.woff2 diff --git a/public/assets/fonts/geist/geist-mono-latin-600-normal.woff2 b/site/public/assets/fonts/geist/geist-mono-latin-600-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-mono-latin-600-normal.woff2 rename to site/public/assets/fonts/geist/geist-mono-latin-600-normal.woff2 diff --git a/public/assets/fonts/geist/geist-mono-latin-700-normal.woff2 b/site/public/assets/fonts/geist/geist-mono-latin-700-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-mono-latin-700-normal.woff2 rename to site/public/assets/fonts/geist/geist-mono-latin-700-normal.woff2 diff --git a/public/assets/fonts/geist/geist-sans-latin-400-normal.woff2 b/site/public/assets/fonts/geist/geist-sans-latin-400-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-sans-latin-400-normal.woff2 rename to site/public/assets/fonts/geist/geist-sans-latin-400-normal.woff2 diff --git a/public/assets/fonts/geist/geist-sans-latin-500-normal.woff2 b/site/public/assets/fonts/geist/geist-sans-latin-500-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-sans-latin-500-normal.woff2 rename to site/public/assets/fonts/geist/geist-sans-latin-500-normal.woff2 diff --git a/public/assets/fonts/geist/geist-sans-latin-600-normal.woff2 b/site/public/assets/fonts/geist/geist-sans-latin-600-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-sans-latin-600-normal.woff2 rename to site/public/assets/fonts/geist/geist-sans-latin-600-normal.woff2 diff --git a/public/assets/fonts/geist/geist-sans-latin-700-normal.woff2 b/site/public/assets/fonts/geist/geist-sans-latin-700-normal.woff2 similarity index 100% rename from public/assets/fonts/geist/geist-sans-latin-700-normal.woff2 rename to site/public/assets/fonts/geist/geist-sans-latin-700-normal.woff2 diff --git a/public/assets/images/avatar-1.png b/site/public/assets/images/avatar-1.png similarity index 100% rename from public/assets/images/avatar-1.png rename to site/public/assets/images/avatar-1.png diff --git a/public/assets/images/avatar-2.png b/site/public/assets/images/avatar-2.png similarity index 100% rename from public/assets/images/avatar-2.png rename to site/public/assets/images/avatar-2.png diff --git a/public/assets/images/avatar-3.png b/site/public/assets/images/avatar-3.png similarity index 100% rename from public/assets/images/avatar-3.png rename to site/public/assets/images/avatar-3.png diff --git a/public/assets/images/screenshot.png b/site/public/assets/images/screenshot.png similarity index 100% rename from public/assets/images/screenshot.png rename to site/public/assets/images/screenshot.png diff --git a/public/assets/social-screenshot.png b/site/public/assets/social-screenshot.png similarity index 100% rename from public/assets/social-screenshot.png rename to site/public/assets/social-screenshot.png diff --git a/public/assets/social.png b/site/public/assets/social.png similarity index 100% rename from public/assets/social.png rename to site/public/assets/social.png diff --git a/docs/src/assets/styles/style-luma.css b/site/src/docs/assets/styles/style-luma.css similarity index 100% rename from docs/src/assets/styles/style-luma.css rename to site/src/docs/assets/styles/style-luma.css diff --git a/docs/src/assets/styles/style-lyra.css b/site/src/docs/assets/styles/style-lyra.css similarity index 100% rename from docs/src/assets/styles/style-lyra.css rename to site/src/docs/assets/styles/style-lyra.css diff --git a/docs/src/assets/styles/style-maia.css b/site/src/docs/assets/styles/style-maia.css similarity index 100% rename from docs/src/assets/styles/style-maia.css rename to site/src/docs/assets/styles/style-maia.css diff --git a/docs/src/assets/styles/style-mira.css b/site/src/docs/assets/styles/style-mira.css similarity index 100% rename from docs/src/assets/styles/style-mira.css rename to site/src/docs/assets/styles/style-mira.css diff --git a/docs/src/assets/styles/style-nova.css b/site/src/docs/assets/styles/style-nova.css similarity index 100% rename from docs/src/assets/styles/style-nova.css rename to site/src/docs/assets/styles/style-nova.css diff --git a/docs/src/assets/styles/style-rhea.css b/site/src/docs/assets/styles/style-rhea.css similarity index 100% rename from docs/src/assets/styles/style-rhea.css rename to site/src/docs/assets/styles/style-rhea.css diff --git a/docs/src/assets/styles/style-sera.css b/site/src/docs/assets/styles/style-sera.css similarity index 100% rename from docs/src/assets/styles/style-sera.css rename to site/src/docs/assets/styles/style-sera.css diff --git a/docs/src/assets/styles/style-vega.css b/site/src/docs/assets/styles/style-vega.css similarity index 100% rename from docs/src/assets/styles/style-vega.css rename to site/src/docs/assets/styles/style-vega.css diff --git a/docs/src/components/accordion.mdx b/site/src/docs/components/accordion.mdx similarity index 100% rename from docs/src/components/accordion.mdx rename to site/src/docs/components/accordion.mdx diff --git a/docs/src/components/alert-dialog.mdx b/site/src/docs/components/alert-dialog.mdx similarity index 100% rename from docs/src/components/alert-dialog.mdx rename to site/src/docs/components/alert-dialog.mdx diff --git a/docs/src/components/alert.mdx b/site/src/docs/components/alert.mdx similarity index 100% rename from docs/src/components/alert.mdx rename to site/src/docs/components/alert.mdx diff --git a/docs/src/components/avatar.mdx b/site/src/docs/components/avatar.mdx similarity index 100% rename from docs/src/components/avatar.mdx rename to site/src/docs/components/avatar.mdx diff --git a/docs/src/components/badge.mdx b/site/src/docs/components/badge.mdx similarity index 100% rename from docs/src/components/badge.mdx rename to site/src/docs/components/badge.mdx diff --git a/docs/src/components/breadcrumb.mdx b/site/src/docs/components/breadcrumb.mdx similarity index 100% rename from docs/src/components/breadcrumb.mdx rename to site/src/docs/components/breadcrumb.mdx diff --git a/docs/src/components/button-group.mdx b/site/src/docs/components/button-group.mdx similarity index 100% rename from docs/src/components/button-group.mdx rename to site/src/docs/components/button-group.mdx diff --git a/docs/src/components/button.mdx b/site/src/docs/components/button.mdx similarity index 100% rename from docs/src/components/button.mdx rename to site/src/docs/components/button.mdx diff --git a/docs/src/components/card.mdx b/site/src/docs/components/card.mdx similarity index 100% rename from docs/src/components/card.mdx rename to site/src/docs/components/card.mdx diff --git a/docs/src/components/chart.mdx b/site/src/docs/components/chart.mdx similarity index 100% rename from docs/src/components/chart.mdx rename to site/src/docs/components/chart.mdx diff --git a/docs/src/components/checkbox.mdx b/site/src/docs/components/checkbox.mdx similarity index 100% rename from docs/src/components/checkbox.mdx rename to site/src/docs/components/checkbox.mdx diff --git a/docs/src/components/combobox.mdx b/site/src/docs/components/combobox.mdx similarity index 100% rename from docs/src/components/combobox.mdx rename to site/src/docs/components/combobox.mdx diff --git a/docs/src/components/command.mdx b/site/src/docs/components/command.mdx similarity index 100% rename from docs/src/components/command.mdx rename to site/src/docs/components/command.mdx diff --git a/docs/src/components/dialog.mdx b/site/src/docs/components/dialog.mdx similarity index 100% rename from docs/src/components/dialog.mdx rename to site/src/docs/components/dialog.mdx diff --git a/docs/src/components/drawer.mdx b/site/src/docs/components/drawer.mdx similarity index 100% rename from docs/src/components/drawer.mdx rename to site/src/docs/components/drawer.mdx diff --git a/docs/src/components/dropdown-menu.mdx b/site/src/docs/components/dropdown-menu.mdx similarity index 100% rename from docs/src/components/dropdown-menu.mdx rename to site/src/docs/components/dropdown-menu.mdx diff --git a/docs/src/components/empty.mdx b/site/src/docs/components/empty.mdx similarity index 100% rename from docs/src/components/empty.mdx rename to site/src/docs/components/empty.mdx diff --git a/docs/src/components/field.mdx b/site/src/docs/components/field.mdx similarity index 100% rename from docs/src/components/field.mdx rename to site/src/docs/components/field.mdx diff --git a/docs/src/components/input-group.mdx b/site/src/docs/components/input-group.mdx similarity index 100% rename from docs/src/components/input-group.mdx rename to site/src/docs/components/input-group.mdx diff --git a/docs/src/components/input.mdx b/site/src/docs/components/input.mdx similarity index 100% rename from docs/src/components/input.mdx rename to site/src/docs/components/input.mdx diff --git a/docs/src/components/item.mdx b/site/src/docs/components/item.mdx similarity index 100% rename from docs/src/components/item.mdx rename to site/src/docs/components/item.mdx diff --git a/docs/src/components/kbd.mdx b/site/src/docs/components/kbd.mdx similarity index 100% rename from docs/src/components/kbd.mdx rename to site/src/docs/components/kbd.mdx diff --git a/docs/src/components/label.mdx b/site/src/docs/components/label.mdx similarity index 100% rename from docs/src/components/label.mdx rename to site/src/docs/components/label.mdx diff --git a/docs/src/components/native-select.mdx b/site/src/docs/components/native-select.mdx similarity index 100% rename from docs/src/components/native-select.mdx rename to site/src/docs/components/native-select.mdx diff --git a/docs/src/components/pagination.mdx b/site/src/docs/components/pagination.mdx similarity index 100% rename from docs/src/components/pagination.mdx rename to site/src/docs/components/pagination.mdx diff --git a/docs/src/components/popover.mdx b/site/src/docs/components/popover.mdx similarity index 100% rename from docs/src/components/popover.mdx rename to site/src/docs/components/popover.mdx diff --git a/docs/src/components/progress.mdx b/site/src/docs/components/progress.mdx similarity index 100% rename from docs/src/components/progress.mdx rename to site/src/docs/components/progress.mdx diff --git a/docs/src/components/radio-group.mdx b/site/src/docs/components/radio-group.mdx similarity index 100% rename from docs/src/components/radio-group.mdx rename to site/src/docs/components/radio-group.mdx diff --git a/docs/src/components/scroll-area.mdx b/site/src/docs/components/scroll-area.mdx similarity index 100% rename from docs/src/components/scroll-area.mdx rename to site/src/docs/components/scroll-area.mdx diff --git a/docs/src/components/select.mdx b/site/src/docs/components/select.mdx similarity index 100% rename from docs/src/components/select.mdx rename to site/src/docs/components/select.mdx diff --git a/docs/src/components/sidebar.mdx b/site/src/docs/components/sidebar.mdx similarity index 100% rename from docs/src/components/sidebar.mdx rename to site/src/docs/components/sidebar.mdx diff --git a/docs/src/components/skeleton.mdx b/site/src/docs/components/skeleton.mdx similarity index 100% rename from docs/src/components/skeleton.mdx rename to site/src/docs/components/skeleton.mdx diff --git a/docs/src/components/slider.mdx b/site/src/docs/components/slider.mdx similarity index 100% rename from docs/src/components/slider.mdx rename to site/src/docs/components/slider.mdx diff --git a/docs/src/components/spinner.mdx b/site/src/docs/components/spinner.mdx similarity index 100% rename from docs/src/components/spinner.mdx rename to site/src/docs/components/spinner.mdx diff --git a/docs/src/components/switch.mdx b/site/src/docs/components/switch.mdx similarity index 100% rename from docs/src/components/switch.mdx rename to site/src/docs/components/switch.mdx diff --git a/docs/src/components/table.mdx b/site/src/docs/components/table.mdx similarity index 100% rename from docs/src/components/table.mdx rename to site/src/docs/components/table.mdx diff --git a/docs/src/components/tabs.mdx b/site/src/docs/components/tabs.mdx similarity index 100% rename from docs/src/components/tabs.mdx rename to site/src/docs/components/tabs.mdx diff --git a/docs/src/components/textarea.mdx b/site/src/docs/components/textarea.mdx similarity index 100% rename from docs/src/components/textarea.mdx rename to site/src/docs/components/textarea.mdx diff --git a/docs/src/components/theme-switcher.mdx b/site/src/docs/components/theme-switcher.mdx similarity index 100% rename from docs/src/components/theme-switcher.mdx rename to site/src/docs/components/theme-switcher.mdx diff --git a/docs/src/components/toast.mdx b/site/src/docs/components/toast.mdx similarity index 100% rename from docs/src/components/toast.mdx rename to site/src/docs/components/toast.mdx diff --git a/docs/src/components/tooltip.mdx b/site/src/docs/components/tooltip.mdx similarity index 100% rename from docs/src/components/tooltip.mdx rename to site/src/docs/components/tooltip.mdx diff --git a/docs/src/customization.mdx b/site/src/docs/customization.mdx similarity index 100% rename from docs/src/customization.mdx rename to site/src/docs/customization.mdx diff --git a/docs/src/docs.json b/site/src/docs/docs.json similarity index 100% rename from docs/src/docs.json rename to site/src/docs/docs.json diff --git a/docs/src/fragments/toast/error.njk b/site/src/docs/fragments/toast/error.njk similarity index 100% rename from docs/src/fragments/toast/error.njk rename to site/src/docs/fragments/toast/error.njk diff --git a/docs/src/fragments/toast/info.njk b/site/src/docs/fragments/toast/info.njk similarity index 100% rename from docs/src/fragments/toast/info.njk rename to site/src/docs/fragments/toast/info.njk diff --git a/docs/src/fragments/toast/success.njk b/site/src/docs/fragments/toast/success.njk similarity index 100% rename from docs/src/fragments/toast/success.njk rename to site/src/docs/fragments/toast/success.njk diff --git a/docs/src/fragments/toast/warning.njk b/site/src/docs/fragments/toast/warning.njk similarity index 100% rename from docs/src/fragments/toast/warning.njk rename to site/src/docs/fragments/toast/warning.njk diff --git a/docs/src/installation.mdx b/site/src/docs/installation.mdx similarity index 100% rename from docs/src/installation.mdx rename to site/src/docs/installation.mdx diff --git a/docs/src/introduction.md b/site/src/docs/introduction.md similarity index 100% rename from docs/src/introduction.md rename to site/src/docs/introduction.md diff --git a/docs/src/site/ContentHeader.astro b/site/src/docs/site/ContentHeader.astro similarity index 100% rename from docs/src/site/ContentHeader.astro rename to site/src/docs/site/ContentHeader.astro diff --git a/docs/src/site/SidebarHeader.astro b/site/src/docs/site/SidebarHeader.astro similarity index 100% rename from docs/src/site/SidebarHeader.astro rename to site/src/docs/site/SidebarHeader.astro diff --git a/docs/src/site/StyleHead.astro b/site/src/docs/site/StyleHead.astro similarity index 100% rename from docs/src/site/StyleHead.astro rename to site/src/docs/site/StyleHead.astro diff --git a/docs/src/site/chart-examples.js b/site/src/docs/site/chart-examples.js similarity index 100% rename from docs/src/site/chart-examples.js rename to site/src/docs/site/chart-examples.js diff --git a/docs/src/site/demo-interactions.js b/site/src/docs/site/demo-interactions.js similarity index 100% rename from docs/src/site/demo-interactions.js rename to site/src/docs/site/demo-interactions.js diff --git a/docs/src/templates.mdx b/site/src/docs/templates.mdx similarity index 100% rename from docs/src/templates.mdx rename to site/src/docs/templates.mdx diff --git a/src/pages/fragments/toast/[type].ts b/site/src/pages/fragments/toast/[type].ts similarity index 100% rename from src/pages/fragments/toast/[type].ts rename to site/src/pages/fragments/toast/[type].ts diff --git a/src/pages/index.astro b/site/src/pages/index.astro similarity index 100% rename from src/pages/index.astro rename to site/src/pages/index.astro diff --git a/src/pages/robots.txt.ts b/site/src/pages/robots.txt.ts similarity index 100% rename from src/pages/robots.txt.ts rename to site/src/pages/robots.txt.ts diff --git a/src/pages/sitemap.xml.ts b/site/src/pages/sitemap.xml.ts similarity index 100% rename from src/pages/sitemap.xml.ts rename to site/src/pages/sitemap.xml.ts diff --git a/wrangler.jsonc b/site/wrangler.jsonc similarity index 100% rename from wrangler.jsonc rename to site/wrangler.jsonc diff --git a/src/jinja/combobox.html.jinja b/src/jinja/combobox.html.jinja deleted file mode 100644 index b558646..0000000 --- a/src/jinja/combobox.html.jinja +++ /dev/null @@ -1,142 +0,0 @@ -{# - Renders an input-first combobox component. -#} -{% macro combobox( - id=None, - selected=None, - name=None, - multiple=false, - placeholder=None, - close_on_select=false, - clear=false, - auto_highlight=false, - format="value", - main_attrs={}, - input_attrs={}, - popover_attrs={}, - listbox_attrs={}, - hidden_input_attrs={} -) %} -{% set id = id or ("combobox-" + (range(100000, 999999) | random | string)) %} -{% set selected_entries = namespace(items=[]) %} -{% if selected is defined and selected is iterable and selected is not string %} - {% set selected_values = selected %} - {% for item in selected %} - {% if item.value is defined %} - {% set selected_entries.items = selected_entries.items + [{'value': item.value, 'label': item.label if item.label is defined else item.value}] %} - {% else %} - {% set selected_entries.items = selected_entries.items + [{'value': item, 'label': item}] %} - {% endif %} - {% endfor %} -{% elif selected is defined and selected %} - {% if selected.value is defined %} - {% set selected_values = [selected.value] %} - {% set selected_entries.items = [{'value': selected.value, 'label': selected.label if selected.label is defined else selected.value}] %} - {% else %} - {% set selected_values = [selected] %} - {% set selected_entries.items = [{'value': selected, 'label': selected}] %} - {% endif %} -{% else %} - {% set selected_values = [] %} -{% endif %} -{% set hidden_value = ((selected_entries.items | tojson if multiple else ((selected_entries.items[0] if selected_entries.items else none) | tojson)) if format == "object" else (selected_values | tojson if multiple else (selected_values[0] if selected_values else ''))) %} - -
- {% if multiple %} - - {% elif clear %} -
- - - - - -
- {% else %} - - - {% endif %} - - -
-{% endmacro %} diff --git a/src/jinja/command.html.jinja b/src/jinja/command.html.jinja deleted file mode 100644 index c258a68..0000000 --- a/src/jinja/command.html.jinja +++ /dev/null @@ -1,203 +0,0 @@ -{# - Renders a standalone command menu component with search and keyboard navigation. - - @param id {string} [optional] - Unique identifier for the command component. - @param items {array} [optional] - Array of items to render (alternative to using caller). - @param placeholder {string} [optional] [default="Type a command or search..."] - Placeholder text for the search input. - @param empty_text {string} [optional] [default="No results found."] - Text displayed when no results match the search. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param input_attrs {object} [optional] - Additional HTML attributes for the search input. - @param menu_attrs {object} [optional] - Additional HTML attributes for the menu div. -#} -{% macro command( - id=None, - items=None, - placeholder="Type a command or search...", - empty_text="No results found.", - main_attrs={}, - input_attrs={}, - menu_attrs={} -) %} -{% set id = id or ("command-" ~ range(100000, 999999) | random | string) %} -
-
- - -
- -
-{% endmacro %} - -{# - Renders a command dialog (modal command palette). - - @param id {string} [optional] - Unique identifier for the command dialog. - @param items {array} [optional] - Array of items to render (alternative to using caller). - @param placeholder {string} [optional] [default="Type a command or search..."] - Placeholder text for the search input. - @param empty_text {string} [optional] [default="No results found."] - Text displayed when no results match the search. - @param dialog_attrs {object} [optional] - Additional HTML attributes for the dialog element. - @param input_attrs {object} [optional] - Additional HTML attributes for the search input. - @param menu_attrs {object} [optional] - Additional HTML attributes for the menu div. - @param open {boolean} [optional] [default=False] - Whether the command dialog should be open initially. -#} -{% macro command_dialog( - id=None, - items=None, - placeholder="Type a command or search...", - empty_text="No results found.", - dialog_attrs={}, - input_attrs={}, - menu_attrs={}, - open=False -) %} -{% set id = id or ("command-dialog-" ~ range(100000, 999999) | random | string) %} - -
-
- - -
- -
-
-{% endmacro %} - -{# - Renders a list of items for the command component. - - @param items {array} - Array of items to render. Each item can be: - - { type: "item", label: "Text or HTML", icon: "HTML", url: "href", keywords: "search terms", disabled: true, attrs: {} } - - { type: "group", label: "Group Title", items: [...] } - - { type: "separator" } - Note: Use attrs to add data-label for alternative search text if needed. If url is provided, renders as instead of
. Label supports HTML (marked as safe). - @param parent_id_prefix {string} [optional] - The prefix for the item id. -#} -{% macro render_command_items(items, parent_id_prefix="items") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
- {{ item.label | safe }} - {{ render_command_items(item['items'], item_id) if item['items'] }} -
- {% elif item.type == "separator" %} -
- {% elif item.type == "item" or not item.type %} - {% if item.url %} -
- {% if item.icon %}{{ item.icon | safe }}{% endif %} - {{ item.label | safe }} - - {% else %} - - {% endif %} - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/jinja/dialog.html.jinja b/src/jinja/dialog.html.jinja deleted file mode 100644 index 640f42d..0000000 --- a/src/jinja/dialog.html.jinja +++ /dev/null @@ -1,92 +0,0 @@ -{# - Renders a dialog component with optional trigger, header, body, and footer. - - @param id {string} - Unique identifier for the dialog component. - @param trigger {string} [optional] - Text or HTML for the button that triggers the dialog. - @param title {string} [optional] - Title text displayed in the dialog header. - @param description {string} [optional] - Description text displayed below the title. - @param footer {string} [optional] - HTML content for the dialog footer. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger button. - @param dialog_attrs {object} [optional] - Additional HTML attributes for the dialog content container. - @param header_attrs {object} [optional] - Additional HTML attributes for the dialog header. - @param body_attrs {object} [optional] - Additional HTML attributes for the dialog body section. - @param footer_attrs {object} [optional] - Additional HTML attributes for the dialog footer. - @param open {boolean} [optional] [default=false] - Whether the dialog should be open initially. - @param close_button {boolean} [optional] [default=true] - Whether to include a close button. - @param close_on_overlay_click {boolean} [optional] [default=true] - Whether clicking the overlay closes the dialog. -#} -{% macro dialog( - id=None, - trigger=None, - title=None, - description=None, - footer=None, - dialog_attrs={}, - trigger_attrs={}, - header_attrs={}, - body_attrs={}, - footer_attrs={}, - open=false, - close_button=true, - close_on_overlay_click=true -) %} -{% set id = id or ("dialog-" + (range(100000, 999999) | random | string)) %} -{% if trigger %} - -{% endif %} - -
- {% if title or description %} -
-

{{ title | safe }}

- {% if description %}

{{ description | safe }}

{% endif %} -
- {% endif %} - {% if caller %} -
- {{ caller() }} -
- {% endif %} - {% if footer %} -
- {{ footer | safe }} -
- {% endif %} - {% if close_button %} - - {% endif %} -
-
-{% endmacro %} diff --git a/src/jinja/dropdown-menu.html.jinja b/src/jinja/dropdown-menu.html.jinja deleted file mode 100644 index 09d831a..0000000 --- a/src/jinja/dropdown-menu.html.jinja +++ /dev/null @@ -1,124 +0,0 @@ -{# - Renders a dropdown menu component. - - @param id {string} [optional] - Unique identifier for the dropdown component. - @param trigger {string} [optional] - HTML content for the button that triggers the dropdown. - @param items {array} [optional] - Array of menu items for the dropdown. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger button. - @param popover_attrs {object} [optional] - Additional HTML attributes for the dropdown content div. -#} -{% macro dropdown_menu( - trigger, - id=None, - items=None, - main_attrs={}, - trigger_attrs={}, - popover_attrs={}, - menu_attrs={} -) %} -{% set id = id or ("dropdown-menu-" + (range(100000, 999999) | random | string)) %} - - -{% endmacro %} - -{# - Renders dropdown menu items recursively. - - @param items {array} - The array of items to render. - @param parent_id_prefix {string} [optional] - Prefix for generating element IDs. -#} -{% macro render_dropdown_items(items, parent_id_prefix="items") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
-
{{ item.label }}
- {{ render_dropdown_items(item['items'], item_id) if item['items'] }} -
- {% elif item.type == "separator" %} -
- {% elif item.type == "item" or not item.type %} - {% if item.url %} - - {% if item.icon %}{{ item.icon | safe }}{% endif %} - {{ item.label | safe }} - - {% else %} - - {% endif %} - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/jinja/popover.html.jinja b/src/jinja/popover.html.jinja deleted file mode 100644 index 7d46211..0000000 --- a/src/jinja/popover.html.jinja +++ /dev/null @@ -1,48 +0,0 @@ -{# - Renders a generic popover component, often used internally by other components like dropdowns or selects. - - @param id {string} [optional] - Unique identifier for the popover component. - @param trigger {string} [optional] - HTML content for the element that triggers the popover. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger element. - @param popover_attrs {object} [optional] - Additional HTML attributes for the popover content div. -#} -{% macro popover( - trigger, - id=None, - main_attrs={}, - trigger_attrs={}, - popover_attrs={} -) %} -{% set id = id or ("popover-" + (range(100000, 999999) | random | string)) %} - -
- - -
-{% endmacro %} \ No newline at end of file diff --git a/src/jinja/select.html.jinja b/src/jinja/select.html.jinja deleted file mode 100644 index efae37c..0000000 --- a/src/jinja/select.html.jinja +++ /dev/null @@ -1,183 +0,0 @@ -{# - Renders a select component. - - @param id {string} [optional] - Unique identifier for the select component. - @param selected {string|array} [optional] - The initially selected value(s). - @param name {string} [optional] - The name attribute for the hidden input storing the selected value. - @param multiple {boolean} [optional] [default=false] - Enables multiple selection mode. - @param placeholder {string} [optional] - Placeholder text shown when no option is selected. - @param close_on_select {boolean} [optional] [default=false] - Closes the popover when selecting an option in multiple mode. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger button. - @param popover_attrs {object} [optional] - Additional HTML attributes for the popover content div. - @param listbox_attrs {object} [optional] - Additional HTML attributes for the listbox div. - @param input_attrs {object} [optional] - Additional HTML attributes for the hidden input. -#} -{% macro select( - id=None, - selected=None, - name=None, - items=[], - multiple=false, - placeholder=None, - close_on_select=false, - format="value", - main_attrs={}, - trigger_attrs={}, - popover_attrs={}, - listbox_attrs={}, - input_attrs={} -) %} -{% set id = id or ("select-" + (range(100000, 999999) | random | string)) %} - -{% if selected is defined and selected is iterable and selected is not string %} - {% set selectedArray = selected %} -{% elif selected is defined %} - {% set selectedArray = [selected] %} -{% else %} - {% set selectedArray = [] %} -{% endif %} -{% set first_option = namespace(item=None) %} -{% set selected_options = namespace(items=[]) %} - -{% if items %} - {% for item in items %} - {% if item.type == "group" %} - {% for sub_item in item['items'] %} - {% if not first_option.item %} - {% set first_option.item = sub_item %} - {% endif %} - {% if sub_item.value in selectedArray %} - {% set selected_options.items = selected_options.items + [sub_item] %} - {% endif %} - {% endfor %} - {% else %} - {% if not first_option.item %} - {% set first_option.item = item %} - {% endif %} - {% if item.value in selectedArray %} - {% set selected_options.items = selected_options.items + [item] %} - {% endif %} - {% endif %} - {% endfor %} -{% endif %} - -{% set default_option = (selected_options.items[0] if selected_options.items else (none if placeholder else first_option.item)) %} -{% set labels = [] %} -{% if multiple and selected_options.items %} - {% for opt in selected_options.items %} - {% set labels = labels + [opt.label] %} - {% endfor %} -{% endif %} -{% set default_label = (', '.join(labels) if (multiple and selected_options.items) else ((placeholder or '') if (placeholder and not selected_options.items) else (default_option.label if default_option else ''))) %} -{% set selected_payload = namespace(items=[]) %} -{% if multiple and selected_options.items %} - {% for opt in selected_options.items %} - {% set selected_payload.items = selected_payload.items + [{'value': opt.value, 'label': opt.label}] %} - {% endfor %} -{% elif default_option %} - {% set selected_payload.items = [{'value': default_option.value, 'label': default_option.label}] %} -{% endif %} - -
- - - -
-{% endmacro %} - -{# - Renders a list of items for the select component. - - @param items {array} - The array of items to render. - @param parent_id_prefix {string} [optional] - The prefix for the item id. -#} -{% macro render_select_items(items, selectedArray, parent_id_prefix="items") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
-
{{ item.label }}
- {{ render_select_items(item['items'], selectedArray, item_id) if item['items'] }} -
- {% elif item.type == "separator" %} -
- {% elif item.type == "item" or not item.type %} -
- {{ item.label | safe }} -
- {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/jinja/sidebar.html.jinja b/src/jinja/sidebar.html.jinja deleted file mode 100644 index d5643ae..0000000 --- a/src/jinja/sidebar.html.jinja +++ /dev/null @@ -1,144 +0,0 @@ -{# - Renders a sidebar component. - - @param id {string} [optional] - Unique identifier for the sidebar component. - @param label {string} [optional] - Label for the sidebar navigation. - @param open {boolean} [optional] - Whether the sidebar is open. - @param side {string} [optional] - Side of the sidebar to display. - @param header {string} [optional] - Header content for the sidebar. - @param footer {string} [optional] - Footer content for the sidebar. - @param menu {array} [optional] - Array of menu items for the sidebar. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param header_attrs {object} [optional] - Additional HTML attributes for the header div. - @param content_attrs {object} [optional] - Additional HTML attributes for the content div. - @param footer_attrs {object} [optional] - Additional HTML attributes for the footer div. -#} -{% macro sidebar( - id=None, - label="Sidebar navigation", - open=true, - side=None, - header=None, - footer=None, - menu=None, - main_attrs={}, - header_attrs={}, - content_attrs={}, - footer_attrs={} -) %} - -{% endmacro %} - -{# - Renders sidebar content recursively (groups, items, submenus, separators). - - @param items {array} - The array of items to render. - @param parent_id_prefix {string} [optional] - Prefix for generating element IDs. -#} -{% macro render_sidebar_content(items, parent_id_prefix="content") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
- {% if item.label %} -

{{ item.label }}

- {% endif %} -
    - {{ render_sidebar_content(item["items"], item_id) if item["items"] }} -
-
- {% elif item.type == "separator" %} -
- {% elif item.type == "submenu" %} -
  • - -
  • - {% elif item.type == "item" or not item.type %} -
  • - - {% if item.icon %}{{ item.icon | safe }}{% endif %} - {{ item.label | safe }} - -
  • - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/jinja/tabs.html.jinja b/src/jinja/tabs.html.jinja deleted file mode 100644 index ebc0905..0000000 --- a/src/jinja/tabs.html.jinja +++ /dev/null @@ -1,80 +0,0 @@ -{# - Renders a tabs component. - - @param id {string} - Unique identifier for the tabs component. - @param tabsets {array} - An array of objects, each representing a tab and its panel. - Each object should have: - - id {string}: Unique identifier prefix for the tab and panel. - - tab {string}: HTML content for the tab button. - - panel {string} [optional]: HTML content for the tab panel. - - tab_attrs {object} [optional]: Additional HTML attributes for the tab button. - - panel_attrs {object} [optional]: Additional HTML attributes for the tab panel div. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param tablist_attrs {object} [optional] - Additional HTML attributes for the tablist nav element. - Set aria-orientation="vertical" for vertical tabs or data-variant="line" for line tabs. - @param default_tab_index {number} [optional] [default=1] - The 1-based index of the tab to be active initially. -#} -{% macro tabs( - id=None, - tabsets=[], - main_attrs={}, - tablist_attrs={}, - default_tab_index=1 - ) -%} -{% set id = id or ("tabs-" + (range(100000, 999999) | random | string)) %} -{% set orientation = tablist_attrs['aria-orientation'] or 'horizontal' %} -
    - - - {% for tabset in tabsets %} - {% if tabset.panel %} -
    - {{ tabset.panel | safe }} -
    - {% endif %} - {% endfor %} -
    -{% endmacro %} diff --git a/src/jinja/toast.html.jinja b/src/jinja/toast.html.jinja deleted file mode 100644 index 720fc88..0000000 --- a/src/jinja/toast.html.jinja +++ /dev/null @@ -1,117 +0,0 @@ -{# - Renders a toaster container and individual toast messages. - Can render the initial container or be used with htmx OOB swaps to add toasts dynamically. - - @param id {string} [optional] [default="toaster"] - Unique identifier for the toaster container. - @param toasts {array} [optional] - An array of toast objects to render initially. See the toast() macro for more details. - @param attrs {object} [optional] - Additional HTML attributes for the main toaster container div. - - Supports caller() for custom toast markup. -#} -{% macro toaster( - id="toaster", - toasts=[], - attrs={} -) %} -
    -{% for item in toasts %} - {{ toast( - category=item.category, - title=item.title, - description=item.description, - action=item.action, - cancel=item.cancel, - attrs=item.attrs - ) }} -{% endfor %} -{{ caller() if caller }} -
    -{% endmacro %} - -{# - Renders a single toast message. - - @param category {string} [optional] [default="success"] - Type of toast ('success', 'error', 'info', 'warning'). Determines icon and ARIA role. - @param title {string} [optional] - The main title text of the toast. - @param description {string} [optional] - The secondary description text. - @param action {object} [optional] - Defines an action button. - - label {string}: Button text. - - onclick {string}: JavaScript code to execute on click. - - url {string}: URL for an anchor link button. - @param cancel {object} [optional] - Defines a cancel/dismiss button (similar structure to action). - - label {string}: Button text. - - onclick {string}: JavaScript code to execute on click. - - url {string}: URL for an anchor link button. - @param attrs {object} [optional] - Additional HTML attributes for the toast div. -#} -{% macro toast( - category="success", - title="", - description="", - action=None, - cancel=None, - attrs={} -) %} -
    -
    - {% if category in ["error", "success", "info", "warning"] %} - {% if category == "success" %} - - {% elif category == "error" %} - - {% elif category == "info" %} - - {% elif category == "warning" %} - - {% endif %} - {% endif %} -
    - {% if title %}

    {{ title }}

    {% endif %} - {% if description %}

    {{ description }}

    {% endif %} -
    - {% if action or cancel %} -
    - {% if action %} - {% if action.href %} - {{ action.label }} - {% else %} - - {% endif %} - {% endif %} - {% if cancel %} - - {% endif %} -
    - {% endif %} -
    -
    -{% endmacro %} \ No newline at end of file diff --git a/src/nunjucks/combobox.njk b/src/nunjucks/combobox.njk deleted file mode 100644 index bd5c05b..0000000 --- a/src/nunjucks/combobox.njk +++ /dev/null @@ -1,157 +0,0 @@ -{# - Renders an input-first combobox component. - - @param id {string} [optional] - Unique identifier for the combobox component. - @param selected {string|array} [optional] - The initially selected value(s). - @param name {string} [optional] - The name attribute for the hidden input storing the selected value. - @param multiple {boolean} [optional] [default=false] - Enables multiple selection mode with chips. - @param placeholder {string} [optional] - Placeholder text for the visible input. - @param close_on_select {boolean} [optional] [default=false] - Closes the popover when selecting an option in multiple mode. - @param clear {boolean} [optional] [default=false] - Shows a clear button in single-select mode. - @param auto_highlight {boolean} [optional] [default=false] - Highlights the first matching option while filtering. - @param format {string} [optional] [default="value"] - Hidden input serialization format: "value" or "object". - @param main_attrs {object} [optional] - Additional HTML attributes for the root div. - @param input_attrs {object} [optional] - Additional HTML attributes for the visible input. - @param popover_attrs {object} [optional] - Additional HTML attributes for the popover div. - @param listbox_attrs {object} [optional] - Additional HTML attributes for the listbox div. - @param hidden_input_attrs {object} [optional] - Additional HTML attributes for the hidden input. -#} -{% macro combobox( - id=None, - selected=None, - name=None, - multiple=false, - placeholder=None, - close_on_select=false, - clear=false, - auto_highlight=false, - format="value", - main_attrs={}, - input_attrs={}, - popover_attrs={}, - listbox_attrs={}, - hidden_input_attrs={} -) %} -{% set id = id or ("combobox-" + (range(100000, 999999) | random | string)) %} -{% set selected_values = [] %} -{% set selected_entries = [] %} -{% if selected is defined and selected is iterable and selected is not string %} - {% for item in selected %} - {% if item.value is defined %} - {% set selected_values = (selected_values.push(item.value), selected_values) %} - {% set selected_entries = (selected_entries.push({ value: item.value, label: (item.label if item.label is defined else item.value) }), selected_entries) %} - {% else %} - {% set selected_values = (selected_values.push(item), selected_values) %} - {% set selected_entries = (selected_entries.push({ value: item, label: item }), selected_entries) %} - {% endif %} - {% endfor %} -{% elif selected is defined and selected %} - {% if selected.value is defined %} - {% set selected_values = [selected.value] %} - {% set selected_entries = [{ value: selected.value, label: (selected.label if selected.label is defined else selected.value) }] %} - {% else %} - {% set selected_values = [selected] %} - {% set selected_entries = [{ value: selected, label: selected }] %} - {% endif %} -{% endif %} -{% set hidden_value = ((selected_entries | dump if multiple else ((selected_entries[0] if selected_entries[0] else None) | dump)) if format == "object" else (selected_values | dump if multiple else (selected_values[0] if selected_values[0] else ''))) %} - -
    - {% if multiple %} - - {% elif clear %} -
    - - - - - -
    - {% else %} - - - {% endif %} - - -
    -{% endmacro %} diff --git a/src/nunjucks/command.njk b/src/nunjucks/command.njk deleted file mode 100644 index 00c8fec..0000000 --- a/src/nunjucks/command.njk +++ /dev/null @@ -1,203 +0,0 @@ -{# - Renders a standalone command menu component with search and keyboard navigation. - - @param id {string} [optional] - Unique identifier for the command component. - @param items {array} [optional] - Array of items to render (alternative to using caller). - @param placeholder {string} [optional] [default="Type a command or search..."] - Placeholder text for the search input. - @param empty_text {string} [optional] [default="No results found."] - Text displayed when no results match the search. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param input_attrs {object} [optional] - Additional HTML attributes for the search input. - @param menu_attrs {object} [optional] - Additional HTML attributes for the menu div. -#} -{% macro command( - id=None, - items=None, - placeholder="Type a command or search...", - empty_text="No results found.", - main_attrs={}, - input_attrs={}, - menu_attrs={} -) %} -{% set id = id or ("command-" + (range(100000, 999999) | random | string)) %} -
    -
    - - -
    - -
    -{% endmacro %} - -{# - Renders a command dialog (modal command palette). - - @param id {string} [optional] - Unique identifier for the command dialog. - @param items {array} [optional] - Array of items to render (alternative to using caller). - @param placeholder {string} [optional] [default="Type a command or search..."] - Placeholder text for the search input. - @param empty_text {string} [optional] [default="No results found."] - Text displayed when no results match the search. - @param dialog_attrs {object} [optional] - Additional HTML attributes for the dialog element. - @param input_attrs {object} [optional] - Additional HTML attributes for the search input. - @param menu_attrs {object} [optional] - Additional HTML attributes for the menu div. - @param open {boolean} [optional] [default=false] - Whether the command dialog should be open initially. -#} -{% macro command_dialog( - id=None, - items=None, - placeholder="Type a command or search...", - empty_text="No results found.", - dialog_attrs={}, - input_attrs={}, - menu_attrs={}, - open=false -) %} -{% set id = id or ("command-dialog-" + (range(100000, 999999) | random | string)) %} - -
    -
    - - -
    - -
    -
    -{% endmacro %} - -{# - Renders a list of items for the command component. - - @param items {array} - Array of items to render. Each item can be: - - { type: "item", label: "Text or HTML", icon: "HTML", url: "href", keywords: "search terms", disabled: true, attrs: {} } - - { type: "group", label: "Group Title", items: [...] } - - { type: "separator" } - Note: Use attrs to add data-label for alternative search text if needed. If url is provided, renders as instead of
    . Label supports HTML (marked as safe). - @param parent_id_prefix {string} [optional] - The prefix for the item id. -#} -{% macro render_command_items(items, parent_id_prefix="items") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
    - {{ item.label | safe }} - {{ render_command_items(item.items, item_id) if item.items }} -
    - {% elif item.type == "separator" %} -
    - {% elif item.type == "item" or not item.type %} - {% if item.url %} -
    - {% if item.icon %}{{ item.icon | safe }}{% endif %} - {{ item.label | safe }} - - {% else %} - - {% endif %} - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/nunjucks/dialog.njk b/src/nunjucks/dialog.njk deleted file mode 100644 index 5b5ac40..0000000 --- a/src/nunjucks/dialog.njk +++ /dev/null @@ -1,92 +0,0 @@ -{# - Renders a dialog component with optional trigger, header, body, and footer. - - @param id {string} - Unique identifier for the dialog component. - @param trigger {string} [optional] - Text or HTML for the button that triggers the dialog. - @param title {string} [optional] - Title text displayed in the dialog header. - @param description {string} [optional] - Description text displayed below the title. - @param footer {string} [optional] - HTML content for the dialog footer. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger button. - @param dialog_attrs {object} [optional] - Additional HTML attributes for the dialog content container. - @param header_attrs {object} [optional] - Additional HTML attributes for the dialog header. - @param body_attrs {object} [optional] - Additional HTML attributes for the dialog body section. - @param footer_attrs {object} [optional] - Additional HTML attributes for the dialog footer. - @param open {boolean} [optional] [default=false] - Whether the dialog should be open initially. - @param close_button {boolean} [optional] [default=true] - Whether to include a close button. - @param close_on_overlay_click {boolean} [optional] [default=true] - Whether clicking the overlay closes the dialog. -#} -{% macro dialog( - id=None, - trigger=None, - title=None, - description=None, - footer=None, - dialog_attrs={}, - trigger_attrs={}, - header_attrs={}, - body_attrs={}, - footer_attrs={}, - open=false, - close_button=true, - close_on_overlay_click=true -) %} -{% set id = id or ("dialog-" + (range(100000, 999999) | random | string)) %} -{% if trigger %} - -{% endif %} - -
    - {% if title or description %} -
    -

    {{ title | safe }}

    - {% if description %}

    {{ description | safe }}

    {% endif %} -
    - {% endif %} - {% if caller %} -
    - {{ caller() }} -
    - {% endif %} - {% if footer %} -
    - {{ footer | safe }} -
    - {% endif %} - {% if close_button %} - - {% endif %} -
    -
    -{% endmacro %} diff --git a/src/nunjucks/dropdown-menu.njk b/src/nunjucks/dropdown-menu.njk deleted file mode 100644 index 2f0cb96..0000000 --- a/src/nunjucks/dropdown-menu.njk +++ /dev/null @@ -1,124 +0,0 @@ -{# - Renders a dropdown menu component. - - @param id {string} [optional] - Unique identifier for the dropdown component. - @param trigger {string} [optional] - HTML content for the button that triggers the dropdown. - @param items {array} [optional] - Array of menu items for the dropdown. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger button. - @param popover_attrs {object} [optional] - Additional HTML attributes for the dropdown content div. -#} -{% macro dropdown_menu( - trigger, - id=None, - items=None, - main_attrs={}, - trigger_attrs={}, - popover_attrs={}, - menu_attrs={} -) %} -{% set id = id or ("dropdown-menu-" + (range(100000, 999999) | random | string)) %} - - -{% endmacro %} - -{# - Renders dropdown menu items recursively. - - @param items {array} - The array of items to render. - @param parent_id_prefix {string} [optional] - Prefix for generating element IDs. -#} -{% macro render_dropdown_items(items, parent_id_prefix="items") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
    -
    {{ item.label }}
    - {{ render_dropdown_items(item.items, item_id) if item.items }} -
    - {% elif item.type == "separator" %} -
    - {% elif item.type == "item" or not item.type %} - {% if item.url %} - - {% if item.icon %}{{ item.icon | safe }}{% endif %} - {{ item.label | safe }} - - {% else %} - - {% endif %} - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/nunjucks/popover.njk b/src/nunjucks/popover.njk deleted file mode 100644 index 1569c11..0000000 --- a/src/nunjucks/popover.njk +++ /dev/null @@ -1,48 +0,0 @@ -{# - Renders a generic popover component, often used internally by other components like dropdowns or selects. - - @param id {string} [optional] - Unique identifier for the popover component. - @param trigger {string} [optional] - HTML content for the element that triggers the popover. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger element. - @param popover_attrs {object} [optional] - Additional HTML attributes for the popover content div. -#} -{% macro popover( - trigger, - id=None, - main_attrs={}, - trigger_attrs={}, - popover_attrs={} -) %} -{% set id = id or ("popover-" + (range(100000, 999999) | random | string)) %} - -
    - - -
    -{% endmacro %} \ No newline at end of file diff --git a/src/nunjucks/select.njk b/src/nunjucks/select.njk deleted file mode 100644 index cb82573..0000000 --- a/src/nunjucks/select.njk +++ /dev/null @@ -1,184 +0,0 @@ -{# - Renders a select component. - - @param id {string} [optional] - Unique identifier for the select component. - @param selected {string|array} [optional] - The initially selected value(s). - @param name {string} [optional] - The name attribute for the hidden input storing the selected value. - @param multiple {boolean} [optional] [default=false] - Enables multiple selection mode. - @param placeholder {string} [optional] - Placeholder text shown when no option is selected. - @param close_on_select {boolean} [optional] [default=false] - Closes the popover when selecting an option in multiple mode. - @param format {string} [optional] [default="value"] - Hidden input serialization format: "value" or "object". - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param trigger_attrs {object} [optional] - Additional HTML attributes for the trigger button. - @param popover_attrs {object} [optional] - Additional HTML attributes for the popover content div. - @param listbox_attrs {object} [optional] - Additional HTML attributes for the listbox div. - @param input_attrs {object} [optional] - Additional HTML attributes for the hidden input. -#} -{% macro select( - id=None, - selected=None, - name=None, - items=None, - multiple=false, - placeholder=None, - close_on_select=false, - format="value", - main_attrs={}, - trigger_attrs={}, - popover_attrs={}, - listbox_attrs={}, - input_attrs={} -) %} -{% set id = id or ("select-" + (range(100000, 999999) | random | string)) %} - -{% if selected is defined and selected is iterable and selected is not string %} - {% set selectedArray = selected %} -{% elif selected is defined %} - {% set selectedArray = [selected] %} -{% else %} - {% set selectedArray = [] %} -{% endif %} -{% set first_option = [] %} -{% set selected_options = [] %} - -{% if items %} - {% for item in items %} - {% if item.type == "group" %} - {% for sub_item in item.items %} - {% if not first_option[0] %} - {% set first_option = (first_option.push(sub_item), first_option) %} - {% endif %} - {% if sub_item.value in selectedArray %} - {% set selected_options = (selected_options.push(sub_item), selected_options) %} - {% endif %} - {% endfor %} - {% else %} - {% if not first_option[0] %} - {% set first_option = (first_option.push(item), first_option) %} - {% endif %} - {% if item.value in selectedArray %} - {% set selected_options = (selected_options.push(item), selected_options) %} - {% endif %} - {% endif %} - {% endfor %} -{% endif %} - -{% set default_option = (selected_options[0] if selected_options[0] else (None if placeholder else (first_option[0] if first_option[0] else None))) %} -{% set labels = [] %} -{% if multiple and selected_options %} - {% for opt in selected_options %} - {% set labels = (labels.push(opt.label), labels) %} - {% endfor %} -{% endif %} -{% set default_label = (labels | join(', ') if (multiple and selected_options) else ((placeholder or '') if (placeholder and not selected_options) else (default_option.label if default_option else ''))) %} -{% set selected_payload = [] %} -{% if multiple and selected_options %} - {% for opt in selected_options %} - {% set selected_payload = (selected_payload.push({ value: opt.value, label: opt.label }), selected_payload) %} - {% endfor %} -{% elif default_option %} - {% set selected_payload = [{ value: default_option.value, label: default_option.label }] %} -{% endif %} - -
    - - - -
    -{% endmacro %} - -{# - Renders a list of items for the select component. - - @param items {array} - The array of items to render. - @param parent_id_prefix {string} [optional] - The prefix for the item id. -#} -{% macro render_select_items(items, selectedArray, parent_id_prefix="items") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
    -
    {{ item.label }}
    - {{ render_select_items(item.items, selectedArray, item_id) if item.items }} -
    - {% elif item.type == "separator" %} -
    - {% elif item.type == "item" or not item.type %} -
    - {{ item.label | safe }} -
    - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/nunjucks/sidebar.njk b/src/nunjucks/sidebar.njk deleted file mode 100644 index 66e425b..0000000 --- a/src/nunjucks/sidebar.njk +++ /dev/null @@ -1,144 +0,0 @@ -{# - Renders a sidebar component. - - @param id {string} [optional] - Unique identifier for the sidebar component. - @param label {string} [optional] - Label for the sidebar navigation. - @param open {boolean} [optional] - Whether the sidebar is open. - @param side {string} [optional] - Side of the sidebar to display. - @param header {string} [optional] - Header content for the sidebar. - @param footer {string} [optional] - Footer content for the sidebar. - @param items {array} [optional] - Array of menu items for the sidebar. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param header_attrs {object} [optional] - Additional HTML attributes for the header element. - @param content_attrs {object} [optional] - Additional HTML attributes for the content section. - @param footer_attrs {object} [optional] - Additional HTML attributes for the footer element. -#} -{% macro sidebar( - id=None, - label="Sidebar navigation", - open=true, - side=None, - header=None, - footer=None, - menu=None, - main_attrs={}, - header_attrs={}, - content_attrs={}, - footer_attrs={} -) %} - -{% endmacro %} - -{# - Renders sidebar content recursively (groups, items, submenus, separators). - - @param items {array} - The array of items to render. - @param parent_id_prefix {string} [optional] - Prefix for generating element IDs. -#} -{% macro render_sidebar_content(items, parent_id_prefix="content") %} - {% for item in items %} - {% set item_id = parent_id_prefix ~ "-" ~ loop.index %} - - {% if item.type == "group" %} - {% set group_label_id = item.id if item.id else "group-label-" + item_id %} -
    - {% if item.label %} -

    {{ item.label }}

    - {% endif %} -
      - {{ render_sidebar_content(item.items, item_id) if item.items }} -
    -
    - {% elif item.type == "separator" %} -
    - {% elif item.type == "submenu" %} -
  • - -
  • - {% elif item.type == "item" or not item.type %} -
  • - - {% if item.icon %}{{ item.icon | safe }}{% endif %} - {{ item.label | safe }} - -
  • - {% endif %} - {% endfor %} -{% endmacro %} diff --git a/src/nunjucks/tabs.njk b/src/nunjucks/tabs.njk deleted file mode 100644 index fa3b1cd..0000000 --- a/src/nunjucks/tabs.njk +++ /dev/null @@ -1,27 +0,0 @@ -{# - Renders a tabs component. - - @param id {string} - Unique identifier for the tabs component. - @param tabsets {array} - An array of objects, each representing a tab and panel. - Each object should have: - - tab {string}: HTML content for the tab button. - - panel {string} [optional]: HTML content for the tab panel. - - tab_attrs {object} [optional]: Additional HTML attributes for the tab button. - - panel_attrs {object} [optional]: Additional HTML attributes for the tab panel div. - @param main_attrs {object} [optional] - Additional HTML attributes for the main container div. - @param tablist_attrs {object} [optional] - Additional HTML attributes for the tablist nav element. - Set aria-orientation="vertical" for vertical tabs or data-variant="line" for line tabs. - @param default_tab_index {number} [optional] [default=1] - The 1-based index of the tab to be active initially. -#} -{%- macro tabs( - id=None, - tabsets=[], - main_attrs={}, - tablist_attrs={}, - default_tab_index=1 - ) --%} -{%- set id = id or ("tabs-" + (range(100000, 999999) | random | string)) -%} -{%- set orientation = tablist_attrs['aria-orientation'] or 'horizontal' -%} -
    {% for tabset in tabsets %}{% if tabset.panel %}
    {{ tabset.panel | safe }}
    {% endif %}{% endfor %}
    -{%- endmacro -%} diff --git a/src/nunjucks/toast.njk b/src/nunjucks/toast.njk deleted file mode 100644 index 7bbf03f..0000000 --- a/src/nunjucks/toast.njk +++ /dev/null @@ -1,117 +0,0 @@ -{# - Renders a toaster container and individual toast messages. - Can render the initial container or be used with htmx OOB swaps to add toasts dynamically. - - @param id {string} [optional] [default="toaster"] - Unique identifier for the toaster container. - @param toasts {array} [optional] - An array of toast objects to render initially. See the toast() macro for more details. - @param attrs {object} [optional] - Additional HTML attributes for the main toaster container div. - - Supports caller() for custom toast markup. -#} -{% macro toaster( - id="toaster", - toasts=[], - attrs={} -) %} -
    -{% for item in toasts %} - {{ toast( - category=item.category, - title=item.title, - description=item.description, - action=item.action, - cancel=item.cancel, - attrs=item.attrs - ) }} -{% endfor %} -{{ caller() if caller }} -
    -{% endmacro %} - -{# - Renders a single toast message. - - @param category {string} [optional] [default="success"] - Type of toast ('success', 'error', 'info', 'warning'). Determines icon and ARIA role. - @param title {string} [optional] - The main title text of the toast. - @param description {string} [optional] - The secondary description text. - @param action {object} [optional] - Defines an action button. - - label {string}: Button text. - - onclick {string}: JavaScript code to execute on click. - - url {string}: URL for an anchor link button. - @param cancel {object} [optional] - Defines a cancel/dismiss button (similar structure to action). - - label {string}: Button text. - - onclick {string}: JavaScript code to execute on click. - - url {string}: URL for an anchor link button. - @param attrs {object} [optional] - Additional HTML attributes for the toast div. -#} -{% macro toast( - category="success", - title="", - description="", - action=None, - cancel=None, - attrs={} -) %} -
    -
    - {% if category in ["error", "success", "info", "warning"] %} - {% if category == "success" %} - - {% elif category == "error" %} - - {% elif category == "info" %} - - {% elif category == "warning" %} - - {% endif %} - {% endif %} -
    - {% if title %}

    {{ title }}

    {% endif %} - {% if description %}

    {{ description }}

    {% endif %} -
    - {% if action or cancel %} - - {% endif %} -
    -
    -{% endmacro %} \ No newline at end of file diff --git a/packages/css/templates/jinja/combobox.html.jinja b/src/templates/jinja/combobox.html.jinja similarity index 100% rename from packages/css/templates/jinja/combobox.html.jinja rename to src/templates/jinja/combobox.html.jinja diff --git a/packages/css/templates/jinja/command.html.jinja b/src/templates/jinja/command.html.jinja similarity index 100% rename from packages/css/templates/jinja/command.html.jinja rename to src/templates/jinja/command.html.jinja diff --git a/packages/css/templates/jinja/dialog.html.jinja b/src/templates/jinja/dialog.html.jinja similarity index 100% rename from packages/css/templates/jinja/dialog.html.jinja rename to src/templates/jinja/dialog.html.jinja diff --git a/packages/css/templates/jinja/dropdown-menu.html.jinja b/src/templates/jinja/dropdown-menu.html.jinja similarity index 100% rename from packages/css/templates/jinja/dropdown-menu.html.jinja rename to src/templates/jinja/dropdown-menu.html.jinja diff --git a/packages/css/templates/jinja/popover.html.jinja b/src/templates/jinja/popover.html.jinja similarity index 100% rename from packages/css/templates/jinja/popover.html.jinja rename to src/templates/jinja/popover.html.jinja diff --git a/packages/css/templates/jinja/select.html.jinja b/src/templates/jinja/select.html.jinja similarity index 100% rename from packages/css/templates/jinja/select.html.jinja rename to src/templates/jinja/select.html.jinja diff --git a/packages/css/templates/jinja/sidebar.html.jinja b/src/templates/jinja/sidebar.html.jinja similarity index 100% rename from packages/css/templates/jinja/sidebar.html.jinja rename to src/templates/jinja/sidebar.html.jinja diff --git a/packages/css/templates/jinja/tabs.html.jinja b/src/templates/jinja/tabs.html.jinja similarity index 100% rename from packages/css/templates/jinja/tabs.html.jinja rename to src/templates/jinja/tabs.html.jinja diff --git a/packages/css/templates/jinja/toast.html.jinja b/src/templates/jinja/toast.html.jinja similarity index 100% rename from packages/css/templates/jinja/toast.html.jinja rename to src/templates/jinja/toast.html.jinja diff --git a/packages/css/templates/nunjucks/combobox.njk b/src/templates/nunjucks/combobox.njk similarity index 100% rename from packages/css/templates/nunjucks/combobox.njk rename to src/templates/nunjucks/combobox.njk diff --git a/packages/css/templates/nunjucks/command.njk b/src/templates/nunjucks/command.njk similarity index 100% rename from packages/css/templates/nunjucks/command.njk rename to src/templates/nunjucks/command.njk diff --git a/packages/css/templates/nunjucks/dialog.njk b/src/templates/nunjucks/dialog.njk similarity index 100% rename from packages/css/templates/nunjucks/dialog.njk rename to src/templates/nunjucks/dialog.njk diff --git a/packages/css/templates/nunjucks/dropdown-menu.njk b/src/templates/nunjucks/dropdown-menu.njk similarity index 100% rename from packages/css/templates/nunjucks/dropdown-menu.njk rename to src/templates/nunjucks/dropdown-menu.njk diff --git a/packages/css/templates/nunjucks/popover.njk b/src/templates/nunjucks/popover.njk similarity index 100% rename from packages/css/templates/nunjucks/popover.njk rename to src/templates/nunjucks/popover.njk diff --git a/packages/css/templates/nunjucks/select.njk b/src/templates/nunjucks/select.njk similarity index 100% rename from packages/css/templates/nunjucks/select.njk rename to src/templates/nunjucks/select.njk diff --git a/packages/css/templates/nunjucks/sidebar.njk b/src/templates/nunjucks/sidebar.njk similarity index 100% rename from packages/css/templates/nunjucks/sidebar.njk rename to src/templates/nunjucks/sidebar.njk diff --git a/packages/css/templates/nunjucks/tabs.njk b/src/templates/nunjucks/tabs.njk similarity index 100% rename from packages/css/templates/nunjucks/tabs.njk rename to src/templates/nunjucks/tabs.njk diff --git a/packages/css/templates/nunjucks/toast.njk b/src/templates/nunjucks/toast.njk similarity index 100% rename from packages/css/templates/nunjucks/toast.njk rename to src/templates/nunjucks/toast.njk