decantr 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +868 -0
- package/CHANGELOG.md +255 -0
- package/CLAUDE.md +178 -0
- package/LICENSE +21 -0
- package/README.md +229 -0
- package/cli/art.js +127 -0
- package/cli/commands/a11y.js +61 -0
- package/cli/commands/audit.js +225 -0
- package/cli/commands/build.js +38 -0
- package/cli/commands/dev.js +18 -0
- package/cli/commands/doctor.js +197 -0
- package/cli/commands/figma-sync.js +48 -0
- package/cli/commands/figma-tokens.js +55 -0
- package/cli/commands/generate.js +26 -0
- package/cli/commands/init.js +116 -0
- package/cli/commands/lint.js +209 -0
- package/cli/commands/mcp.js +530 -0
- package/cli/commands/migrate.js +175 -0
- package/cli/commands/test.js +38 -0
- package/cli/commands/validate.js +354 -0
- package/cli/index.js +113 -0
- package/package.json +95 -0
- package/reference/atoms.md +517 -0
- package/reference/behaviors.md +384 -0
- package/reference/build-tooling.md +275 -0
- package/reference/color-guidelines.md +965 -0
- package/reference/component-lifecycle.md +137 -0
- package/reference/compound-spacing.md +95 -0
- package/reference/decantation-process.md +499 -0
- package/reference/dev-server-routes.md +93 -0
- package/reference/form-system.md +253 -0
- package/reference/i18n.md +336 -0
- package/reference/icons.md +576 -0
- package/reference/llm-primer.md +953 -0
- package/reference/plugins.md +252 -0
- package/reference/registry-consumption.md +76 -0
- package/reference/router.md +217 -0
- package/reference/shells.md +116 -0
- package/reference/spatial-guidelines.md +541 -0
- package/reference/ssr.md +234 -0
- package/reference/state-data.md +215 -0
- package/reference/state-patterns.md +166 -0
- package/reference/state.md +194 -0
- package/reference/style-system.md +110 -0
- package/reference/tokens.md +460 -0
- package/src/app.js +19 -0
- package/src/chart/_animate.js +266 -0
- package/src/chart/_base.js +109 -0
- package/src/chart/_data.js +209 -0
- package/src/chart/_format.js +106 -0
- package/src/chart/_interact.js +364 -0
- package/src/chart/_palette.js +105 -0
- package/src/chart/_renderer.js +52 -0
- package/src/chart/_scene.js +262 -0
- package/src/chart/_shared.js +371 -0
- package/src/chart/index.js +637 -0
- package/src/chart/layouts/_layout-base.js +328 -0
- package/src/chart/layouts/cartesian.js +148 -0
- package/src/chart/layouts/hierarchy.js +562 -0
- package/src/chart/layouts/polar.js +101 -0
- package/src/chart/renderers/canvas.js +179 -0
- package/src/chart/renderers/svg.js +256 -0
- package/src/chart/renderers/webgpu.js +715 -0
- package/src/chart/types/_type-base.js +26 -0
- package/src/chart/types/area.js +134 -0
- package/src/chart/types/bar.js +173 -0
- package/src/chart/types/box-plot.js +125 -0
- package/src/chart/types/bubble.js +63 -0
- package/src/chart/types/candlestick.js +115 -0
- package/src/chart/types/chord.js +85 -0
- package/src/chart/types/combination.js +108 -0
- package/src/chart/types/funnel.js +68 -0
- package/src/chart/types/gauge.js +163 -0
- package/src/chart/types/heatmap.js +98 -0
- package/src/chart/types/histogram.js +71 -0
- package/src/chart/types/line.js +111 -0
- package/src/chart/types/org-chart.js +93 -0
- package/src/chart/types/pie.js +81 -0
- package/src/chart/types/radar.js +96 -0
- package/src/chart/types/radial.js +68 -0
- package/src/chart/types/range-area.js +55 -0
- package/src/chart/types/range-bar.js +61 -0
- package/src/chart/types/sankey.js +73 -0
- package/src/chart/types/scatter.js +66 -0
- package/src/chart/types/sparkline.js +81 -0
- package/src/chart/types/sunburst.js +69 -0
- package/src/chart/types/swimlane.js +88 -0
- package/src/chart/types/treemap.js +62 -0
- package/src/chart/types/waterfall.js +100 -0
- package/src/components/_base.js +1658 -0
- package/src/components/_behaviors.js +1140 -0
- package/src/components/_primitives.js +534 -0
- package/src/components/_qr-encoder.js +539 -0
- package/src/components/accordion.js +207 -0
- package/src/components/affix.js +62 -0
- package/src/components/alert-dialog.js +75 -0
- package/src/components/alert.js +47 -0
- package/src/components/aspect-ratio.js +24 -0
- package/src/components/avatar-group.js +55 -0
- package/src/components/avatar.js +38 -0
- package/src/components/back-top.js +75 -0
- package/src/components/badge.js +74 -0
- package/src/components/banner.js +68 -0
- package/src/components/breadcrumb.js +162 -0
- package/src/components/button.js +115 -0
- package/src/components/calendar.js +131 -0
- package/src/components/card.js +192 -0
- package/src/components/carousel.js +98 -0
- package/src/components/cascader.js +261 -0
- package/src/components/checkbox.js +80 -0
- package/src/components/chip.js +81 -0
- package/src/components/code-block.js +82 -0
- package/src/components/collapsible.js +50 -0
- package/src/components/color-palette.js +438 -0
- package/src/components/color-picker.js +314 -0
- package/src/components/combobox.js +181 -0
- package/src/components/command.js +174 -0
- package/src/components/comment.js +206 -0
- package/src/components/context-menu.js +76 -0
- package/src/components/data-table.js +724 -0
- package/src/components/date-picker.js +217 -0
- package/src/components/date-range-picker.js +244 -0
- package/src/components/datetime-picker.js +271 -0
- package/src/components/descriptions.js +68 -0
- package/src/components/drawer.js +179 -0
- package/src/components/dropdown.js +88 -0
- package/src/components/empty.js +41 -0
- package/src/components/float-button.js +90 -0
- package/src/components/form.js +106 -0
- package/src/components/hover-card.js +49 -0
- package/src/components/icon.js +87 -0
- package/src/components/image.js +97 -0
- package/src/components/index.js +117 -0
- package/src/components/input-group.js +75 -0
- package/src/components/input-number.js +155 -0
- package/src/components/input-otp.js +178 -0
- package/src/components/input.js +91 -0
- package/src/components/kbd.js +36 -0
- package/src/components/label.js +25 -0
- package/src/components/list.js +118 -0
- package/src/components/masked-input.js +236 -0
- package/src/components/mentions.js +165 -0
- package/src/components/menu.js +259 -0
- package/src/components/message.js +80 -0
- package/src/components/modal.js +147 -0
- package/src/components/navigation-menu.js +166 -0
- package/src/components/notification.js +84 -0
- package/src/components/pagination.js +104 -0
- package/src/components/placeholder.js +132 -0
- package/src/components/popconfirm.js +70 -0
- package/src/components/popover.js +58 -0
- package/src/components/progress.js +61 -0
- package/src/components/qrcode.js +251 -0
- package/src/components/radiogroup.js +120 -0
- package/src/components/range-slider.js +176 -0
- package/src/components/rate.js +186 -0
- package/src/components/resizable.js +83 -0
- package/src/components/result.js +57 -0
- package/src/components/scroll-area.js +43 -0
- package/src/components/segmented.js +97 -0
- package/src/components/select.js +165 -0
- package/src/components/separator.js +31 -0
- package/src/components/shell.js +407 -0
- package/src/components/skeleton.js +39 -0
- package/src/components/slider.js +141 -0
- package/src/components/sortable-list.js +176 -0
- package/src/components/space.js +42 -0
- package/src/components/spinner.js +112 -0
- package/src/components/splitter.js +147 -0
- package/src/components/statistic.js +136 -0
- package/src/components/steps.js +99 -0
- package/src/components/switch.js +95 -0
- package/src/components/table.js +44 -0
- package/src/components/tabs.js +216 -0
- package/src/components/tag.js +115 -0
- package/src/components/textarea.js +82 -0
- package/src/components/time-picker.js +153 -0
- package/src/components/time-range-picker.js +170 -0
- package/src/components/timeline.js +226 -0
- package/src/components/toast.js +71 -0
- package/src/components/toggle.js +213 -0
- package/src/components/tooltip.js +57 -0
- package/src/components/tour.js +159 -0
- package/src/components/transfer.js +163 -0
- package/src/components/tree-select.js +274 -0
- package/src/components/tree.js +141 -0
- package/src/components/typography.js +136 -0
- package/src/components/upload.js +118 -0
- package/src/components/visually-hidden.js +20 -0
- package/src/components/watermark.js +124 -0
- package/src/core/index.js +539 -0
- package/src/core/lifecycle.js +69 -0
- package/src/css/atoms.js +651 -0
- package/src/css/components.js +940 -0
- package/src/css/derive.js +1296 -0
- package/src/css/index.js +265 -0
- package/src/css/runtime.js +268 -0
- package/src/css/styles/addons/bioluminescent.js +93 -0
- package/src/css/styles/addons/clay.js +70 -0
- package/src/css/styles/addons/clean.js +57 -0
- package/src/css/styles/addons/command-center.js +143 -0
- package/src/css/styles/addons/dopamine.js +83 -0
- package/src/css/styles/addons/editorial.js +80 -0
- package/src/css/styles/addons/glassmorphism.js +99 -0
- package/src/css/styles/addons/liquid-glass.js +105 -0
- package/src/css/styles/addons/prismatic.js +100 -0
- package/src/css/styles/addons/retro.js +63 -0
- package/src/css/styles/auradecantism.js +96 -0
- package/src/css/theme-registry.js +444 -0
- package/src/data/entity.js +281 -0
- package/src/data/index.js +13 -0
- package/src/data/persist.js +225 -0
- package/src/data/query.js +839 -0
- package/src/data/realtime.js +299 -0
- package/src/data/url.js +177 -0
- package/src/data/worker.js +134 -0
- package/src/explorer/archetypes.js +243 -0
- package/src/explorer/atoms.js +228 -0
- package/src/explorer/charts.js +497 -0
- package/src/explorer/components.js +129 -0
- package/src/explorer/foundations.js +949 -0
- package/src/explorer/icons.js +178 -0
- package/src/explorer/patterns.js +247 -0
- package/src/explorer/recipes.js +194 -0
- package/src/explorer/shared/pattern-examples.js +1337 -0
- package/src/explorer/shared/showcase-renderer.js +958 -0
- package/src/explorer/shared/spec-table.js +41 -0
- package/src/explorer/shared/usage-links.js +87 -0
- package/src/explorer/shell-config.js +10 -0
- package/src/explorer/shells.js +551 -0
- package/src/explorer/styles.js +161 -0
- package/src/explorer/tokens.js +262 -0
- package/src/explorer/tools.js +525 -0
- package/src/form/index.js +804 -0
- package/src/i18n/index.js +251 -0
- package/src/icons/essential.js +479 -0
- package/src/icons/index.js +53 -0
- package/src/plugins/index.js +282 -0
- package/src/registry/archetypes/content-site.json +71 -0
- package/src/registry/archetypes/docs-explorer.json +23 -0
- package/src/registry/archetypes/ecommerce.json +104 -0
- package/src/registry/archetypes/financial-dashboard.json +77 -0
- package/src/registry/archetypes/index.json +41 -0
- package/src/registry/archetypes/portfolio.json +82 -0
- package/src/registry/archetypes/recipe-community.json +159 -0
- package/src/registry/archetypes/saas-dashboard.json +86 -0
- package/src/registry/architect/cross-cutting.json +45 -0
- package/src/registry/architect/domains/ecommerce.json +294 -0
- package/src/registry/architect/domains/financial-services.json +302 -0
- package/src/registry/architect/index.json +26 -0
- package/src/registry/architect/traits.json +379 -0
- package/src/registry/atoms.json +16 -0
- package/src/registry/chart-showcase.json +160 -0
- package/src/registry/chart.json +136 -0
- package/src/registry/components.json +8616 -0
- package/src/registry/core.json +216 -0
- package/src/registry/css.json +319 -0
- package/src/registry/data.json +135 -0
- package/src/registry/foundations.json +11 -0
- package/src/registry/icons.json +463 -0
- package/src/registry/index.json +101 -0
- package/src/registry/patterns/activity-feed.json +37 -0
- package/src/registry/patterns/article-content.json +27 -0
- package/src/registry/patterns/auth-form.json +37 -0
- package/src/registry/patterns/author-card.json +20 -0
- package/src/registry/patterns/card-grid.json +127 -0
- package/src/registry/patterns/category-nav.json +26 -0
- package/src/registry/patterns/chart-grid.json +36 -0
- package/src/registry/patterns/chat-interface.json +37 -0
- package/src/registry/patterns/checklist-card.json +55 -0
- package/src/registry/patterns/comparison-panel.json +27 -0
- package/src/registry/patterns/component-showcase.json +24 -0
- package/src/registry/patterns/contact-form.json +31 -0
- package/src/registry/patterns/cta-section.json +20 -0
- package/src/registry/patterns/data-table.json +37 -0
- package/src/registry/patterns/detail-header.json +83 -0
- package/src/registry/patterns/detail-panel.json +27 -0
- package/src/registry/patterns/explorer-shell.json +22 -0
- package/src/registry/patterns/filter-bar.json +33 -0
- package/src/registry/patterns/filter-sidebar.json +27 -0
- package/src/registry/patterns/form-sections.json +110 -0
- package/src/registry/patterns/goal-tracker.json +27 -0
- package/src/registry/patterns/hero.json +107 -0
- package/src/registry/patterns/index.json +47 -0
- package/src/registry/patterns/kpi-grid.json +36 -0
- package/src/registry/patterns/media-gallery.json +20 -0
- package/src/registry/patterns/order-history.json +20 -0
- package/src/registry/patterns/pagination.json +19 -0
- package/src/registry/patterns/photo-to-recipe.json +36 -0
- package/src/registry/patterns/pipeline-tracker.json +28 -0
- package/src/registry/patterns/post-list.json +27 -0
- package/src/registry/patterns/pricing-table.json +32 -0
- package/src/registry/patterns/scorecard.json +28 -0
- package/src/registry/patterns/search-bar.json +20 -0
- package/src/registry/patterns/specimen-grid.json +19 -0
- package/src/registry/patterns/stat-card.json +55 -0
- package/src/registry/patterns/stats-bar.json +55 -0
- package/src/registry/patterns/steps-card.json +55 -0
- package/src/registry/patterns/table-of-contents.json +19 -0
- package/src/registry/patterns/testimonials.json +21 -0
- package/src/registry/patterns/timeline.json +27 -0
- package/src/registry/patterns/token-inspector.json +21 -0
- package/src/registry/patterns/wizard.json +27 -0
- package/src/registry/recipe-auradecantism.json +69 -0
- package/src/registry/recipe-clean.json +65 -0
- package/src/registry/recipe-command-center.json +78 -0
- package/src/registry/router.json +73 -0
- package/src/registry/schema/README.md +197 -0
- package/src/registry/skeletons.json +259 -0
- package/src/registry/state.json +137 -0
- package/src/registry/tokens.json +40 -0
- package/src/router/hash.js +17 -0
- package/src/router/history.js +18 -0
- package/src/router/index.js +598 -0
- package/src/ssr/index.js +922 -0
- package/src/state/arrays.js +181 -0
- package/src/state/devtools.js +647 -0
- package/src/state/index.js +498 -0
- package/src/state/middleware.js +288 -0
- package/src/state/scheduler.js +206 -0
- package/src/state/store.js +300 -0
- package/src/tags/index.js +19 -0
- package/src/tannins/auth.js +396 -0
- package/src/test/dom.js +352 -0
- package/src/test/index.js +62 -0
- package/src/test/state.js +306 -0
- package/tools/a11y-audit.js +487 -0
- package/tools/analyzer.js +315 -0
- package/tools/audit.js +706 -0
- package/tools/builder.js +1422 -0
- package/tools/css-extract.js +188 -0
- package/tools/dev-server.js +316 -0
- package/tools/dts-gen.js +1260 -0
- package/tools/figma-components.js +329 -0
- package/tools/figma-patterns.js +516 -0
- package/tools/figma-plugin/code.js +453 -0
- package/tools/figma-plugin/manifest.json +14 -0
- package/tools/figma-plugin/ui.html +268 -0
- package/tools/figma-render.js +293 -0
- package/tools/figma-tokens.js +712 -0
- package/tools/figma-upload.js +318 -0
- package/tools/generate.js +738 -0
- package/tools/icons.js +133 -0
- package/tools/init-templates.js +265 -0
- package/tools/install-hooks.sh +5 -0
- package/tools/migrations/0.5.0.js +53 -0
- package/tools/migrations/0.6.0.js +95 -0
- package/tools/minify.js +170 -0
- package/tools/pre-commit +4 -0
- package/tools/registry.js +662 -0
- package/tools/reset-playground.js +61 -0
- package/tools/starter-templates/content-site/app.js +49 -0
- package/tools/starter-templates/content-site/essence.js +19 -0
- package/tools/starter-templates/content-site/pages.js +31 -0
- package/tools/starter-templates/ecommerce/app.js +50 -0
- package/tools/starter-templates/ecommerce/essence.js +19 -0
- package/tools/starter-templates/ecommerce/pages.js +31 -0
- package/tools/starter-templates/landing-page/app.js +38 -0
- package/tools/starter-templates/landing-page/essence.js +18 -0
- package/tools/starter-templates/landing-page/pages.js +21 -0
- package/tools/starter-templates/portfolio/app.js +45 -0
- package/tools/starter-templates/portfolio/essence.js +19 -0
- package/tools/starter-templates/portfolio/pages.js +33 -0
- package/tools/starter-templates/saas-dashboard/app.js +70 -0
- package/tools/starter-templates/saas-dashboard/essence.js +19 -0
- package/tools/starter-templates/saas-dashboard/pages.js +31 -0
- package/tools/verify-pack.js +203 -0
- package/types/chart.d.ts +77 -0
- package/types/components.d.ts +587 -0
- package/types/core.d.ts +89 -0
- package/types/css.d.ts +149 -0
- package/types/data.d.ts +238 -0
- package/types/form.d.ts +164 -0
- package/types/i18n.d.ts +51 -0
- package/types/icons.d.ts +27 -0
- package/types/index.d.ts +13 -0
- package/types/router.d.ts +116 -0
- package/types/ssr.d.ts +102 -0
- package/types/state.d.ts +83 -0
- package/types/tags.d.ts +62 -0
- package/types/tannins.d.ts +63 -0
- package/types/test.d.ts +48 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://decantr.ai/schemas/recipe.v1.json",
|
|
3
|
+
"id": "clean",
|
|
4
|
+
"name": "Clean",
|
|
5
|
+
"style": "clean",
|
|
6
|
+
"mode": "light",
|
|
7
|
+
"description": "Professional, understated visual language. Subtle shadows, rounded corners, thin borders, smooth motion. No gradients, no glass, no glow. Closest to the shadcn/Tailwind aesthetic — universally appropriate.",
|
|
8
|
+
"setup": "import { setStyle, setMode } from 'decantr/css';\nsetStyle('clean');\nsetMode('light');",
|
|
9
|
+
"decorators": {
|
|
10
|
+
"cl-card": "Clean card with subtle shadow and rounded corners. Standard elevated container.",
|
|
11
|
+
"cl-divider": "Thin border divider with muted color. Use between sections.",
|
|
12
|
+
"cl-section": "Padded section wrapper with optional muted background.",
|
|
13
|
+
"cl-muted-bg": "Soft muted background for contrast sections. Apply to alternating page sections.",
|
|
14
|
+
"cl-badge-dot": "Small status dot before badge text. Minimal status indicator.",
|
|
15
|
+
"cl-subtle-hover": "Smooth hover background transition. For list items and nav links."
|
|
16
|
+
},
|
|
17
|
+
"compositions": {
|
|
18
|
+
"panel": {
|
|
19
|
+
"description": "Clean panel with shadow and rounded corners.",
|
|
20
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('_b1 _r4 _shadow _bgbg') },\n div({ class: css('_flex _aic _jcsb _px4 _py3 _borderB') },\n span({ class: css('_textsm _bold') }, 'Panel Title')\n ),\n div({ class: css('_p4') },\n // content here\n )\n)"
|
|
21
|
+
},
|
|
22
|
+
"card": {
|
|
23
|
+
"wraps": "Card",
|
|
24
|
+
"description": "Standard card with subtle shadow. No extra decoration needed — clean style tokens handle the look.",
|
|
25
|
+
"example": "Card({},\n Card.Header({},\n span({ class: css('_heading5') }, 'Feature')\n ),\n Card.Body({},\n p({ class: css('_fgmuted _textsm') }, 'Description text here')\n )\n)"
|
|
26
|
+
},
|
|
27
|
+
"kpi": {
|
|
28
|
+
"wraps": "Statistic",
|
|
29
|
+
"description": "KPI metric in a simple bordered card.",
|
|
30
|
+
"example": "const { div } = tags;\ndiv({ class: css('_b1 _r4 _p4') },\n Statistic({\n label: 'Total Revenue',\n value: 2450000,\n prefix: '$',\n trend: 'up',\n trendValue: '+18.2%'\n })\n)"
|
|
31
|
+
},
|
|
32
|
+
"table": {
|
|
33
|
+
"wraps": "DataTable",
|
|
34
|
+
"description": "DataTable in a bordered container with clean header.",
|
|
35
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('_b1 _r4 _overflow[hidden]') },\n div({ class: css('_flex _aic _jcsb _px4 _py3 _borderB') },\n span({ class: css('_heading5') }, 'Users'),\n span({ class: css('_textsm _fgmuted') }, '1,248 total')\n ),\n DataTable({ columns, data, sortable: true, paginate: true })\n)"
|
|
36
|
+
},
|
|
37
|
+
"form": {
|
|
38
|
+
"description": "Form in a card with clean layout.",
|
|
39
|
+
"example": "const { div, h2 } = tags;\nCard({ class: css('_mw[480px]') },\n Card.Header({},\n h2({ class: css('_heading4') }, 'Sign In')\n ),\n Card.Body({ class: css('_flex _col _gap3') },\n Input({ label: 'Email', type: 'email' }),\n Input({ label: 'Password', type: 'password' }),\n Button({ variant: 'primary', class: css('_wfull') }, 'Continue')\n )\n)"
|
|
40
|
+
},
|
|
41
|
+
"sidebar": {
|
|
42
|
+
"description": "Clean sidebar with muted background and simple nav items.",
|
|
43
|
+
"example": "const { aside, nav, span } = tags;\naside({ class: css('_flex _col _h[100vh] _w[240px] _borderR _bgmuted _p3') },\n span({ class: css('_heading5 _mb6 _px3') }, 'App Name'),\n nav({ class: css('_flex _col _gap1') },\n // nav items: _flex _aic _gap2 _p2 _px3 _r2 _trans\n )\n)"
|
|
44
|
+
},
|
|
45
|
+
"layout": {
|
|
46
|
+
"description": "Full page layout with sidebar and content area. Light background, no visual effects.",
|
|
47
|
+
"example": "const { div, main, header, span } = tags;\ndiv({ class: css('_grid _h[100vh] _bgbg'), style: 'grid-template-columns:240px 1fr' },\n // sidebar with _bgmuted _borderR\n // ...,\n div({ class: css('_flex _col _overflow[hidden]') },\n header({ class: css('_flex _aic _jcsb _px6 _py3 _borderB') },\n span({ class: css('_heading4') }, 'Dashboard')\n ),\n main({ class: css('_flex _col _gap4 _p6 _overflow[auto]') },\n // page content\n )\n )\n)"
|
|
48
|
+
},
|
|
49
|
+
"alert": {
|
|
50
|
+
"wraps": "Alert",
|
|
51
|
+
"description": "Standard Alert — clean tokens handle the styling.",
|
|
52
|
+
"example": "Alert({ variant: 'info' },\n 'Your subscription renews in 3 days.'\n)"
|
|
53
|
+
},
|
|
54
|
+
"modal": {
|
|
55
|
+
"wraps": "Modal",
|
|
56
|
+
"description": "Standard Modal with clean styling — no extra decoration needed.",
|
|
57
|
+
"example": "const { div, h2 } = tags;\nModal({\n visible: showModal,\n onClose: () => setShowModal(false)\n},\n h2({ class: css('_heading4 _mb4') }, 'Confirm Action'),\n div({ class: css('_flex _col _gap4') },\n // modal content\n )\n)"
|
|
58
|
+
},
|
|
59
|
+
"chart": {
|
|
60
|
+
"wraps": "Chart",
|
|
61
|
+
"description": "Chart in bordered container with clean header.",
|
|
62
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('_b1 _r4 _overflow[hidden]') },\n div({ class: css('_flex _aic _jcsb _px4 _py3 _borderB') },\n span({ class: css('_bold') }, 'Revenue Trend'),\n span({ class: css('_textxs _fgmuted') }, 'Last 30 days')\n ),\n Chart({ type: 'area', data: revenueData, x: 'date', y: 'amount', height: 300 })\n)"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://decantr.ai/schemas/recipe.v1.json",
|
|
3
|
+
"id": "command-center",
|
|
4
|
+
"name": "Command Center",
|
|
5
|
+
"style": "command-center",
|
|
6
|
+
"mode": "dark",
|
|
7
|
+
"description": "HUD/radar visual language. Monochromatic cyan, beveled frames, scanlines, status bars. All standard Decantr components work — this recipe describes how to COMPOSE them differently for the Command Center aesthetic.",
|
|
8
|
+
"setup": "import { setStyle, setMode } from 'decantr/css';\nsetStyle('command-center');\nsetMode('dark');",
|
|
9
|
+
"decorators": {
|
|
10
|
+
"cc-frame": "Beveled octagonal border frame. Apply to containers, panels, and section wrappers.",
|
|
11
|
+
"cc-frame-sm": "Smaller bevel variant for Cards and compact panels.",
|
|
12
|
+
"cc-corner": "Corner bracket decorations (top-left + bottom-right). Apply to section containers.",
|
|
13
|
+
"cc-scanline": "Subtle horizontal scanline overlay. Apply to data-heavy areas and backgrounds.",
|
|
14
|
+
"cc-grid": "Faint grid-line pattern background. Apply to page backgrounds and large containers.",
|
|
15
|
+
"cc-bar": "Status bar row — flex, uppercase, tracked, border-bottom. Use as panel headers.",
|
|
16
|
+
"cc-bar-bottom": "Status bar variant with border-top instead. Use as panel footers.",
|
|
17
|
+
"cc-blink": "Slow 2s pulse animation for status indicators and dots.",
|
|
18
|
+
"cc-glow": "Cyan glow shadow effect. Apply to important/active elements.",
|
|
19
|
+
"cc-glow-strong": "Stronger glow variant for hero KPIs and primary actions.",
|
|
20
|
+
"cc-glow-pulse": "Animated glow pulse (3s loop). Use sparingly for critical status.",
|
|
21
|
+
"cc-divider": "HUD-style dashed horizontal rule.",
|
|
22
|
+
"cc-label": "Uppercase micro label with wide letter-spacing.",
|
|
23
|
+
"cc-data": "Monospace tabular-nums readout styling for data values.",
|
|
24
|
+
"cc-indicator": "Square status dot (uses currentColor).",
|
|
25
|
+
"cc-indicator-ok": "Green status indicator.",
|
|
26
|
+
"cc-indicator-warn": "Warning status indicator.",
|
|
27
|
+
"cc-indicator-error": "Error status indicator.",
|
|
28
|
+
"cc-mesh": "Subtle radial gradient background for page-level containers."
|
|
29
|
+
},
|
|
30
|
+
"compositions": {
|
|
31
|
+
"panel": {
|
|
32
|
+
"description": "Standard HUD panel. Beveled frame with status bar header.",
|
|
33
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('cc-frame') },\n div({ class: css('cc-bar') },\n span('SYSTEM STATUS'),\n span({ class: css('cc-indicator cc-indicator-ok cc-blink') })\n ),\n div({ class: css('_p4') },\n // content here\n )\n)"
|
|
34
|
+
},
|
|
35
|
+
"card": {
|
|
36
|
+
"wraps": "Card",
|
|
37
|
+
"description": "Command Center card. Standard Card wrapped in cc-frame with status bar header.",
|
|
38
|
+
"example": "const { div, span, h3 } = tags;\ndiv({ class: css('cc-frame-sm') },\n Card({},\n Card.Header({},\n div({ class: css('cc-bar') },\n span({ class: css('cc-label') }, 'THREAT LEVEL'),\n span({ class: css('cc-indicator cc-indicator-warn cc-blink') })\n )\n ),\n Card.Body({},\n span({ class: css('cc-data _heading2') }, '42')\n ),\n Card.Footer({ class: css('cc-bar-bottom') },\n span({ class: css('cc-label') }, 'UPDATED 14:32:07')\n )\n )\n)"
|
|
39
|
+
},
|
|
40
|
+
"kpi": {
|
|
41
|
+
"wraps": "Statistic",
|
|
42
|
+
"description": "KPI metric display with HUD frame and glow.",
|
|
43
|
+
"example": "const { div } = tags;\ndiv({ class: css('cc-frame-sm cc-glow') },\n Statistic({\n title: 'ACTIVE THREATS',\n value: () => count(),\n icon: 'alert-triangle',\n class: css('_bg[transparent]')\n })\n)"
|
|
44
|
+
},
|
|
45
|
+
"table": {
|
|
46
|
+
"wraps": "DataTable",
|
|
47
|
+
"description": "Data table in HUD frame with scanline overlay and live status bar.",
|
|
48
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('cc-frame cc-scanline') },\n div({ class: css('cc-bar') },\n span({ class: css('cc-label') }, 'SIGNAL LOG'),\n span({ class: css('cc-label cc-blink') }, 'LIVE')\n ),\n DataTable({ columns, data })\n)"
|
|
49
|
+
},
|
|
50
|
+
"form": {
|
|
51
|
+
"description": "Form inputs in Command Center style. Standard components with cc-frame wrapper.",
|
|
52
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('cc-frame') },\n div({ class: css('cc-bar') },\n span({ class: css('cc-label') }, 'AUTHENTICATION')\n ),\n div({ class: css('_p4 _flex _col _gap3') },\n Input({ label: 'CALLSIGN' }),\n Input({ label: 'ACCESS CODE', type: 'password' }),\n Button({ variant: 'primary' }, 'AUTHORIZE')\n )\n)"
|
|
53
|
+
},
|
|
54
|
+
"sidebar": {
|
|
55
|
+
"description": "Navigation sidebar with HUD frame and grid background.",
|
|
56
|
+
"example": "const { div, nav, span, a } = tags;\ndiv({ class: css('cc-frame cc-grid _h[100vh]') },\n div({ class: css('cc-bar') },\n span({ class: css('cc-label') }, 'NAV SYSTEM')\n ),\n nav({ class: css('_flex _col _gap1 _p3') },\n a({ href: '#overview', class: css('_p2 _px3 cc-label') }, 'OVERVIEW'),\n a({ href: '#fleet', class: css('_p2 _px3 cc-label') }, 'FLEET MAP'),\n a({ href: '#alerts', class: css('_p2 _px3 cc-label') }, 'ALERTS')\n )\n)"
|
|
57
|
+
},
|
|
58
|
+
"layout": {
|
|
59
|
+
"description": "Full page Command Center layout. CSS grid with sidebar + main content area.",
|
|
60
|
+
"example": "const { div, main, header, span } = tags;\ndiv({ class: css('_grid _h[100vh] cc-mesh'), style: 'grid-template-columns:240px 1fr' },\n // sidebar (cc-frame + cc-grid)\n // ...,\n div({ class: css('_flex _col _overflow[hidden]') },\n header({ class: css('cc-bar') },\n span({ class: css('cc-label') }, 'COMMAND CENTER'),\n span({ class: css('cc-data') }, new Date().toISOString())\n ),\n main({ class: css('_flex _col _gap4 _p4 _overflow[auto]') },\n // page content — panels, kpis, tables\n )\n )\n)"
|
|
61
|
+
},
|
|
62
|
+
"alert": {
|
|
63
|
+
"wraps": "Alert",
|
|
64
|
+
"description": "Alert/notification in Command Center style.",
|
|
65
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('cc-frame-sm') },\n Alert({ variant: 'warning' },\n span({ class: css('cc-label') }, 'WARNING: PERIMETER BREACH DETECTED')\n )\n)"
|
|
66
|
+
},
|
|
67
|
+
"modal": {
|
|
68
|
+
"wraps": "Modal",
|
|
69
|
+
"description": "Modal dialog with HUD frame. Apply cc-frame to content panel via class.",
|
|
70
|
+
"example": "const { div, span } = tags;\nModal({\n visible: showModal,\n onClose: () => setShowModal(false),\n class: css('cc-frame')\n},\n div({ class: css('cc-bar') },\n span({ class: css('cc-label') }, 'CONFIRM ACTION')\n ),\n div({ class: css('_p4') },\n // modal content\n )\n)"
|
|
71
|
+
},
|
|
72
|
+
"chart": {
|
|
73
|
+
"wraps": "Chart",
|
|
74
|
+
"description": "Chart area with HUD frame and scanline overlay.",
|
|
75
|
+
"example": "const { div, span } = tags;\ndiv({ class: css('cc-frame cc-scanline') },\n div({ class: css('cc-bar') },\n span({ class: css('cc-label') }, 'FUEL CONSUMPTION'),\n span({ class: css('cc-data cc-blink') }, 'STREAMING')\n ),\n Chart({ type: 'line', data: fuelData, x: 'date', y: 'litres', height: 300 })\n)"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://decantr.ai/schemas/module.v1.json",
|
|
3
|
+
"module": "decantr/router",
|
|
4
|
+
"description": "Client-side routing — hash or history mode",
|
|
5
|
+
"functions": {
|
|
6
|
+
"createRouter": {
|
|
7
|
+
"params": [
|
|
8
|
+
{
|
|
9
|
+
"name": "config",
|
|
10
|
+
"type": "RouterConfig"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"returns": "{ navigate: Function, outlet: Function, current: Function, path: Function, destroy: Function, onNavigate: Function }",
|
|
14
|
+
"description": "Create a router instance."
|
|
15
|
+
},
|
|
16
|
+
"navigate": {
|
|
17
|
+
"params": [
|
|
18
|
+
{
|
|
19
|
+
"name": "to",
|
|
20
|
+
"type": "string|{ name: string, params?: Object }"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "opts",
|
|
24
|
+
"type": "{ replace?: boolean }",
|
|
25
|
+
"optional": true
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"description": "Navigate programmatically. Delegates to active router."
|
|
29
|
+
},
|
|
30
|
+
"link": {
|
|
31
|
+
"params": [
|
|
32
|
+
{
|
|
33
|
+
"name": "props",
|
|
34
|
+
"type": "{ href: string, activeClass?: string, exact?: boolean, class?: string }"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "children",
|
|
38
|
+
"type": "...any"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"returns": "HTMLAnchorElement",
|
|
42
|
+
"description": "Create a router-aware anchor element with active link detection."
|
|
43
|
+
},
|
|
44
|
+
"useRoute": {
|
|
45
|
+
"returns": "() => { path: string, params: Object, query: Object, component: Function|null, components: Function[], matched: boolean, name?: string, meta: Object }",
|
|
46
|
+
"description": "Get current route signal. The returned signal includes a `meta` field — an object merged from parent routes down to the matched leaf. Parent meta is applied first, child meta overrides. Example: `{ path: '/admin', meta: { requiresAuth: true, breadcrumb: 'Admin' }, component: AdminPage }`"
|
|
47
|
+
},
|
|
48
|
+
"useSearchParams": {
|
|
49
|
+
"returns": "[() => URLSearchParams, (params: Object|URLSearchParams) => void]",
|
|
50
|
+
"description": "Reactive search params. Returns [getter, setter] tuple. Getter returns URLSearchParams from current URL query string. Setter updates query params without triggering full navigation."
|
|
51
|
+
},
|
|
52
|
+
"onNavigate": {
|
|
53
|
+
"params": [
|
|
54
|
+
{
|
|
55
|
+
"name": "callback",
|
|
56
|
+
"type": "(to: Object, from: Object) => void"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"returns": "() => void",
|
|
60
|
+
"description": "Subscribe to navigation events on the active router. Returns an unsubscribe function."
|
|
61
|
+
},
|
|
62
|
+
"back": {
|
|
63
|
+
"description": "Navigate back in history. Delegates to active router. /"
|
|
64
|
+
},
|
|
65
|
+
"forward": {
|
|
66
|
+
"description": "Navigate forward in history. Delegates to active router. /"
|
|
67
|
+
},
|
|
68
|
+
"isNavigating": {
|
|
69
|
+
"returns": "boolean",
|
|
70
|
+
"description": "Reactive boolean signal — true while lazy routes are resolving."
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Decantr Registry Extension Schemas
|
|
2
|
+
|
|
3
|
+
Decantr's registry (patterns, recipes, archetypes, traits) is community-extensible. This document describes the JSON schemas for each registry type so you can create and share your own.
|
|
4
|
+
|
|
5
|
+
## Discovery Mechanism
|
|
6
|
+
|
|
7
|
+
1. **Local overrides:** Place files in your project's `src/registry/patterns/`, `src/registry/recipe-*.json`, or `src/registry/archetypes/`
|
|
8
|
+
2. **NPM packages:** Packages with `"decantr-registry": true` in `package.json` are auto-scanned
|
|
9
|
+
3. **CLI discovery:** `decantr generate` merges local + npm registries (local takes priority)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Pattern Schema
|
|
14
|
+
|
|
15
|
+
**Location:** `src/registry/patterns/{id}.json`
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"$schema": "https://decantr.ai/schemas/pattern.v1.json",
|
|
20
|
+
"id": "my-pattern",
|
|
21
|
+
"name": "My Pattern",
|
|
22
|
+
"description": "When and where to use this pattern.",
|
|
23
|
+
"components": ["ComponentA", "ComponentB"],
|
|
24
|
+
"default_blend": {
|
|
25
|
+
"layout": "stack | grid | row | flex",
|
|
26
|
+
"atoms": "_flex _col _gap4 _p4",
|
|
27
|
+
"slots": {
|
|
28
|
+
"slot-name": "Description of what goes in this slot"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"recipe_overrides": {
|
|
32
|
+
"recipe-id": {
|
|
33
|
+
"wrapper": "css-class-name",
|
|
34
|
+
"atoms": "additional-atoms",
|
|
35
|
+
"notes": "How to adapt this pattern for the recipe"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"code": {
|
|
39
|
+
"imports": "import { tags } from 'decantr/tags';...",
|
|
40
|
+
"example": "function MyPattern() { ... }"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Required Fields
|
|
46
|
+
- `id` — Unique kebab-case identifier
|
|
47
|
+
- `name` — Human-readable name
|
|
48
|
+
- `description` — When/where/why to use this pattern
|
|
49
|
+
- `components` — Array of component names used (from `decantr/components` or `decantr/chart`)
|
|
50
|
+
- `default_blend` — Layout specification
|
|
51
|
+
- `layout` — One of: `stack` (vertical), `grid` (responsive cells), `row` (horizontal), `flex` (flexible)
|
|
52
|
+
- `atoms` — Space-separated atom classes for the container
|
|
53
|
+
- `slots` — Named semantic regions with descriptions
|
|
54
|
+
|
|
55
|
+
### Optional Fields
|
|
56
|
+
- `recipe_overrides` — Per-recipe visual customizations
|
|
57
|
+
- `code.imports` — Import statements for the example
|
|
58
|
+
- `code.example` — Complete working code example (highest-leverage field for LLM code generation)
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Recipe Schema
|
|
63
|
+
|
|
64
|
+
**Location:** `src/registry/recipe-{id}.json`
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"$schema": "https://decantr.ai/schemas/recipe.v1.json",
|
|
69
|
+
"id": "my-recipe",
|
|
70
|
+
"name": "My Recipe",
|
|
71
|
+
"style": "auradecantism",
|
|
72
|
+
"mode": "dark",
|
|
73
|
+
"description": "Visual language description.",
|
|
74
|
+
"setup": "import { setStyle, setMode } from 'decantr/css';\nsetStyle('my-style');\nsetMode('dark');",
|
|
75
|
+
"decorators": {
|
|
76
|
+
"class-name": "What this decorator does and where to apply it"
|
|
77
|
+
},
|
|
78
|
+
"compositions": {
|
|
79
|
+
"panel": {
|
|
80
|
+
"description": "How to compose a panel with this recipe",
|
|
81
|
+
"example": "const { div } = tags;\ndiv({ class: css('...') }, ...)"
|
|
82
|
+
},
|
|
83
|
+
"card": {
|
|
84
|
+
"wraps": "Card",
|
|
85
|
+
"description": "How to style a Card component",
|
|
86
|
+
"example": "..."
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Required Fields
|
|
93
|
+
- `id` — Unique kebab-case identifier
|
|
94
|
+
- `name` — Human-readable name
|
|
95
|
+
- `style` — Which Decantr style this recipe is designed for
|
|
96
|
+
- `mode` — Preferred color mode (`light`, `dark`, `auto`)
|
|
97
|
+
- `description` — Visual language overview
|
|
98
|
+
|
|
99
|
+
### Required Compositions (10 standard)
|
|
100
|
+
Every recipe should include these 10 compositions for consistency:
|
|
101
|
+
`panel`, `card`, `kpi`, `table`, `form`, `sidebar`, `layout`, `alert`, `modal`, `chart`
|
|
102
|
+
|
|
103
|
+
### Optional Fields
|
|
104
|
+
- `setup` — Code to initialize the style/mode
|
|
105
|
+
- `decorators` — Custom CSS classes provided by the recipe's style
|
|
106
|
+
- `compositions.*.wraps` — Which standard component this composition wraps
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Archetype Schema
|
|
111
|
+
|
|
112
|
+
**Location:** `src/registry/archetypes/{id}.json`
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"$schema": "https://decantr.ai/schemas/archetype.v1.json",
|
|
117
|
+
"id": "my-archetype",
|
|
118
|
+
"name": "My Archetype",
|
|
119
|
+
"description": "Domain overview.",
|
|
120
|
+
"suggested_vintage": {
|
|
121
|
+
"styles": ["clean", "auradecantism"],
|
|
122
|
+
"modes": ["light", "auto"]
|
|
123
|
+
},
|
|
124
|
+
"tannins": ["auth", "search", "analytics"],
|
|
125
|
+
"pages": [
|
|
126
|
+
{
|
|
127
|
+
"id": "home",
|
|
128
|
+
"skeleton": "top-nav-main",
|
|
129
|
+
"default_blend": ["hero", { "cols": ["product-grid"], "at": "md" }, "cta-section"]
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Required Fields
|
|
136
|
+
- `id` — Unique kebab-case identifier
|
|
137
|
+
- `name` — Human-readable domain name
|
|
138
|
+
- `description` — What kind of application this archetype represents
|
|
139
|
+
- `pages` — Array of page definitions with `id`, `skeleton`, and `default_blend`
|
|
140
|
+
|
|
141
|
+
### Blend Format
|
|
142
|
+
Each item in `default_blend` is either:
|
|
143
|
+
- `"pattern-id"` — Full-width pattern row
|
|
144
|
+
- `{ "cols": ["a", "b"], "at": "lg" }` — Equal-width side-by-side, collapse below breakpoint
|
|
145
|
+
- `{ "cols": ["a", "b"], "span": { "a": 3 }, "at": "md" }` — Weighted columns (a=3fr, b=1fr)
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Trait Schema
|
|
150
|
+
|
|
151
|
+
**Location:** `src/registry/architect/traits.json`
|
|
152
|
+
|
|
153
|
+
Traits are the compositional building blocks the LLM uses to dynamically compose archetypes.
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"traits": {
|
|
158
|
+
"trait-id": {
|
|
159
|
+
"description": "What this UI trait provides",
|
|
160
|
+
"triggers": ["keyword1", "keyword2"],
|
|
161
|
+
"skeleton": "skeleton-id or null",
|
|
162
|
+
"patterns": ["pattern-id"],
|
|
163
|
+
"co-occurs": {
|
|
164
|
+
"other-trait-id": 0.85
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"composites": {
|
|
169
|
+
"composite-id": {
|
|
170
|
+
"description": "Pre-packaged trait combination",
|
|
171
|
+
"traits": ["trait-a", "trait-b", "trait-c"],
|
|
172
|
+
"suggested_vintage": { "style": "clean", "mode": "light" }
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Trait Fields
|
|
179
|
+
- `triggers` — Keywords that activate this trait from user intent
|
|
180
|
+
- `skeleton` — Optional skeleton to use when this trait is the primary layout driver
|
|
181
|
+
- `patterns` — Patterns this trait maps to
|
|
182
|
+
- `co-occurs` — Other traits that commonly appear alongside, with affinity weight (0.0-1.0)
|
|
183
|
+
|
|
184
|
+
### Composite Fields
|
|
185
|
+
- `traits` — Ordered list of trait IDs that form this composite
|
|
186
|
+
- `suggested_vintage` — Recommended style/mode for this composite
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Publishing a Registry Package
|
|
191
|
+
|
|
192
|
+
1. Create your patterns/recipes/archetypes following the schemas above
|
|
193
|
+
2. Add `"decantr-registry": true` to your `package.json`
|
|
194
|
+
3. Place registry files under `src/registry/` in your package
|
|
195
|
+
4. Publish to npm
|
|
196
|
+
|
|
197
|
+
Users install your package and Decantr automatically discovers the registry files.
|