@specverse/engines 4.1.30 → 4.2.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/assets/examples/manifests/frontend-only.yaml +3 -6
- package/assets/examples/manifests/fullstack-app.yaml +5 -7
- package/assets/examples/manifests/fullstack-monorepo.yaml +3 -6
- package/dist/inference/comprehensive-engine.d.ts.map +1 -1
- package/dist/inference/comprehensive-engine.js +3 -19
- package/dist/inference/comprehensive-engine.js.map +1 -1
- package/dist/inference/core/rule-engine.d.ts +31 -0
- package/dist/inference/core/rule-engine.d.ts.map +1 -1
- package/dist/inference/core/rule-engine.js +117 -33
- package/dist/inference/core/rule-engine.js.map +1 -1
- package/dist/inference/core/rule-file-types.d.ts +0 -2
- package/dist/inference/core/rule-file-types.d.ts.map +1 -1
- package/dist/inference/core/rule-file-types.js +3 -6
- package/dist/inference/core/rule-file-types.js.map +1 -1
- package/dist/inference/core/rule-loader.d.ts +5 -15
- package/dist/inference/core/rule-loader.d.ts.map +1 -1
- package/dist/inference/core/rule-loader.js +43 -132
- package/dist/inference/core/rule-loader.js.map +1 -1
- package/dist/inference/core/types.d.ts +0 -6
- package/dist/inference/core/types.d.ts.map +1 -1
- package/dist/inference/core/types.js +0 -4
- package/dist/inference/core/types.js.map +1 -1
- package/dist/inference/logical/generators/component-type-resolver.d.ts +0 -26
- package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -1
- package/dist/inference/logical/generators/component-type-resolver.js +0 -19
- package/dist/inference/logical/generators/component-type-resolver.js.map +1 -1
- package/dist/inference/logical/generators/specialist-view-expander.d.ts +1 -17
- package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -1
- package/dist/inference/logical/generators/specialist-view-expander.js +0 -15
- package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -1
- package/dist/inference/logical/generators/view-generator.d.ts +4 -14
- package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
- package/dist/inference/logical/generators/view-generator.js +6 -26
- package/dist/inference/logical/generators/view-generator.js.map +1 -1
- package/dist/inference/logical/index.d.ts +2 -2
- package/dist/inference/logical/index.d.ts.map +1 -1
- package/dist/inference/logical/logical-engine.d.ts.map +1 -1
- package/dist/inference/logical/logical-engine.js +17 -80
- package/dist/inference/logical/logical-engine.js.map +1 -1
- package/dist/inference/quint-transpiler.d.ts +5 -3
- package/dist/inference/quint-transpiler.d.ts.map +1 -1
- package/dist/inference/quint-transpiler.js +11 -6
- package/dist/inference/quint-transpiler.js.map +1 -1
- package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +121 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +78 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +190 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +45 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/html-to-jsx.js +192 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/list-body-composer.js +46 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +30 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/package-json-generator.js +38 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/regen-safety.js +89 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/view-emitter.js +56 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
- package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +14 -11
- package/dist/realize/index.d.ts.map +1 -1
- package/dist/realize/index.js +15 -22
- package/dist/realize/index.js.map +1 -1
- package/dist/registry/utils/manifest-adapter.d.ts +8 -1
- package/dist/registry/utils/manifest-adapter.d.ts.map +1 -1
- package/dist/registry/utils/manifest-adapter.js +8 -1
- package/dist/registry/utils/manifest-adapter.js.map +1 -1
- package/libs/instance-factories/applications/react-app-starter.yaml +150 -0
- package/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/dashboard-body-composer.test.ts +153 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/detail-body-composer.test.ts +145 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +175 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/helpers-emitter.test.ts +55 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/html-to-jsx.test.ts +140 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/list-body-composer.test.ts +146 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/orchestrator.test.ts +163 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p2-factory-imports.test.ts +116 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p3-rendered-output.test.ts +183 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/regen-safety.test.ts +144 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/starter-generators.test.ts +114 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/view-emitter.test.ts +107 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/views-generator.test.ts +139 -0
- package/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.ts +141 -0
- package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +174 -0
- package/libs/instance-factories/applications/templates/react-starter/detail-body-composer.ts +135 -0
- package/libs/instance-factories/applications/templates/react-starter/form-body-composer.ts +306 -0
- package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +60 -0
- package/libs/instance-factories/applications/templates/react-starter/html-to-jsx.ts +334 -0
- package/libs/instance-factories/applications/templates/react-starter/list-body-composer.ts +120 -0
- package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +80 -0
- package/libs/instance-factories/applications/templates/react-starter/package-json-generator.ts +57 -0
- package/libs/instance-factories/applications/templates/react-starter/regen-safety.ts +157 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +47 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +94 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +114 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +72 -0
- package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +151 -0
- package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +14 -11
- package/package.json +3 -3
- package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +0 -530
- package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +0 -73
- package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +0 -99
- package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +0 -49
- package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +0 -156
- package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +0 -935
- package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +0 -646
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +0 -65
- package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +0 -355
- package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +0 -91
- package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +0 -79
- package/dist/libs/instance-factories/views/index.js +0 -48
- package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +0 -742
- package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +0 -824
- package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +0 -719
- package/dist/libs/instance-factories/views/templates/react/app-generator.js +0 -45
- package/dist/libs/instance-factories/views/templates/react/components-generator.js +0 -820
- package/dist/libs/instance-factories/views/templates/react/forms-generator.js +0 -275
- package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +0 -46
- package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +0 -81
- package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +0 -9
- package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +0 -23
- package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +0 -21
- package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +0 -299
- package/dist/libs/instance-factories/views/templates/react/router-generator.js +0 -136
- package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +0 -107
- package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +0 -187
- package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +0 -7
- package/dist/libs/instance-factories/views/templates/react/types-generator.js +0 -56
- package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +0 -27
- package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +0 -29
- package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +0 -261
- package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +0 -34
- package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -800
- package/dist/libs/instance-factories/views/templates/shared/base-generator.js +0 -305
- package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +0 -517
- package/dist/libs/instance-factories/views/templates/shared/composite-pattern-types.js +0 -0
- package/dist/libs/instance-factories/views/templates/shared/composite-patterns.js +0 -445
- package/dist/libs/instance-factories/views/templates/shared/index.js +0 -80
- package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +0 -210
- package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +0 -492
- package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -321
- package/dist/realize/index.js.bak +0 -758
- package/libs/instance-factories/applications/react-app.yaml +0 -186
- package/libs/instance-factories/applications/templates/react/_view-components-source.ts +0 -555
- package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +0 -94
- package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +0 -106
- package/libs/instance-factories/applications/templates/react/package-json-generator.ts +0 -57
- package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +0 -179
- package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +0 -1347
- package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +0 -704
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +0 -84
- package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/view-form-generator.ts +0 -362
- package/libs/instance-factories/applications/templates/react/view-list-generator.ts +0 -98
- package/libs/instance-factories/applications/templates/react/view-router-generator.ts +0 -89
- package/libs/instance-factories/views/README.md +0 -62
- package/libs/instance-factories/views/index.d.ts +0 -13
- package/libs/instance-factories/views/index.d.ts.map +0 -1
- package/libs/instance-factories/views/index.js +0 -18
- package/libs/instance-factories/views/index.js.map +0 -1
- package/libs/instance-factories/views/index.ts +0 -45
- package/libs/instance-factories/views/react-components.yaml +0 -129
- package/libs/instance-factories/views/templates/ARCHITECTURE.md +0 -198
- package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +0 -869
- package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +0 -953
- package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +0 -806
- package/libs/instance-factories/views/templates/react/app-generator.ts +0 -55
- package/libs/instance-factories/views/templates/react/components-generator.ts +0 -938
- package/libs/instance-factories/views/templates/react/forms-generator.ts +0 -325
- package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +0 -57
- package/libs/instance-factories/views/templates/react/hooks-generator.ts +0 -106
- package/libs/instance-factories/views/templates/react/index-css-generator.ts +0 -14
- package/libs/instance-factories/views/templates/react/index-html-generator.ts +0 -34
- package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +0 -29
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +0 -152
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/react/react-component-generator.js +0 -398
- package/libs/instance-factories/views/templates/react/react-component-generator.js.map +0 -1
- package/libs/instance-factories/views/templates/react/react-component-generator.ts +0 -533
- package/libs/instance-factories/views/templates/react/router-generator.ts +0 -197
- package/libs/instance-factories/views/templates/react/router-generic-generator.ts +0 -132
- package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +0 -196
- package/libs/instance-factories/views/templates/react/spec-json-generator.ts +0 -17
- package/libs/instance-factories/views/templates/react/types-generator.ts +0 -76
- package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +0 -42
- package/libs/instance-factories/views/templates/react/vite-config-generator.ts +0 -38
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +0 -1
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +0 -474
- package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +0 -242
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +0 -77
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/adapter-types.js +0 -47
- package/libs/instance-factories/views/templates/shared/adapter-types.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/adapter-types.ts +0 -142
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +0 -63
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -822
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +0 -908
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts +0 -247
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/base-generator.js +0 -363
- package/libs/instance-factories/views/templates/shared/base-generator.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/base-generator.ts +0 -608
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +0 -254
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/component-metadata.js +0 -602
- package/libs/instance-factories/views/templates/shared/component-metadata.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/component-metadata.ts +0 -803
- package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +0 -250
- package/libs/instance-factories/views/templates/shared/composite-patterns.ts +0 -535
- package/libs/instance-factories/views/templates/shared/index.ts +0 -68
- package/libs/instance-factories/views/templates/shared/pattern-validator.ts +0 -279
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +0 -149
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/property-mapper.js +0 -580
- package/libs/instance-factories/views/templates/shared/property-mapper.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/property-mapper.ts +0 -700
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +0 -143
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -420
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +0 -539
|
@@ -1,719 +0,0 @@
|
|
|
1
|
-
const shadcnAdapter = {
|
|
2
|
-
name: "shadcn/ui",
|
|
3
|
-
version: "latest",
|
|
4
|
-
description: "shadcn/ui component library adapter",
|
|
5
|
-
baseDependencies: [
|
|
6
|
-
{ name: "react", version: "^18.2.0" },
|
|
7
|
-
{ name: "react-dom", version: "^18.2.0" },
|
|
8
|
-
{ name: "tailwindcss", version: "^3.4.0" },
|
|
9
|
-
{ name: "@radix-ui/react-icons", version: "^1.3.0" },
|
|
10
|
-
{ name: "class-variance-authority", version: "^0.7.0" },
|
|
11
|
-
{ name: "clsx", version: "^2.0.0" },
|
|
12
|
-
{ name: "tailwind-merge", version: "^2.0.0" }
|
|
13
|
-
],
|
|
14
|
-
config: {
|
|
15
|
-
importPrefix: "@/components/ui",
|
|
16
|
-
importStyle: "named"
|
|
17
|
-
},
|
|
18
|
-
components: {
|
|
19
|
-
// =====================================================================
|
|
20
|
-
// DATA DISPLAY (9 types)
|
|
21
|
-
// =====================================================================
|
|
22
|
-
table: {
|
|
23
|
-
imports: [
|
|
24
|
-
"import { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from '@/components/ui/table'"
|
|
25
|
-
],
|
|
26
|
-
render: (ctx) => {
|
|
27
|
-
const { properties, model, name } = ctx;
|
|
28
|
-
const columns = properties.columns || ["id"];
|
|
29
|
-
const modelVar = model?.name?.toLowerCase() || "item";
|
|
30
|
-
const pluralVar = `${modelVar}s`;
|
|
31
|
-
return `<Table>
|
|
32
|
-
<TableHeader>
|
|
33
|
-
<TableRow>
|
|
34
|
-
${columns.map((col) => `<TableHead>${col}</TableHead>`).join("\n ")}
|
|
35
|
-
</TableRow>
|
|
36
|
-
</TableHeader>
|
|
37
|
-
<TableBody>
|
|
38
|
-
{${pluralVar}?.map((${modelVar}) => (
|
|
39
|
-
<TableRow key={${modelVar}.id}>
|
|
40
|
-
${columns.map((col) => `<TableCell>{${modelVar}.${col}}</TableCell>`).join("\n ")}
|
|
41
|
-
</TableRow>
|
|
42
|
-
))}
|
|
43
|
-
</TableBody>
|
|
44
|
-
</Table>`;
|
|
45
|
-
},
|
|
46
|
-
dependencies: [{ name: "@/components/ui/table", version: "latest" }]
|
|
47
|
-
},
|
|
48
|
-
list: {
|
|
49
|
-
imports: ["import { ScrollArea } from '@/components/ui/scroll-area'"],
|
|
50
|
-
render: (ctx) => {
|
|
51
|
-
const { properties, children } = ctx;
|
|
52
|
-
const className = properties.dense ? "space-y-1" : "space-y-4";
|
|
53
|
-
return `<ScrollArea className="${className}">
|
|
54
|
-
${children || "/* List items */"}
|
|
55
|
-
</ScrollArea>`;
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
grid: {
|
|
59
|
-
imports: [],
|
|
60
|
-
render: (ctx) => {
|
|
61
|
-
const { properties, children } = ctx;
|
|
62
|
-
const columns = properties.columns || 3;
|
|
63
|
-
const gap = properties.gap === "small" ? "2" : properties.gap === "large" ? "8" : "4";
|
|
64
|
-
return `<div className="grid grid-cols-${columns} gap-${gap}">
|
|
65
|
-
${children || "/* Grid items */"}
|
|
66
|
-
</div>`;
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
card: {
|
|
70
|
-
imports: [
|
|
71
|
-
"import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@/components/ui/card'"
|
|
72
|
-
],
|
|
73
|
-
render: (ctx) => {
|
|
74
|
-
const { properties, children } = ctx;
|
|
75
|
-
const { title, subtitle, variant } = properties;
|
|
76
|
-
if (variant === "metric") {
|
|
77
|
-
return `<Card>
|
|
78
|
-
<CardHeader>
|
|
79
|
-
<CardTitle className="text-sm font-medium">${title || properties.metric || "Metric"}</CardTitle>
|
|
80
|
-
</CardHeader>
|
|
81
|
-
<CardContent>
|
|
82
|
-
<div className="text-2xl font-bold">{/* Value */}</div>
|
|
83
|
-
${properties.showTrend ? '<p className="text-xs text-muted-foreground">\u2191 12% from last month</p>' : ""}
|
|
84
|
-
</CardContent>
|
|
85
|
-
</Card>`;
|
|
86
|
-
}
|
|
87
|
-
return `<Card>
|
|
88
|
-
${title ? `<CardHeader>
|
|
89
|
-
<CardTitle>${title}</CardTitle>
|
|
90
|
-
${subtitle ? `<CardDescription>${subtitle}</CardDescription>` : ""}
|
|
91
|
-
</CardHeader>` : ""}
|
|
92
|
-
<CardContent>
|
|
93
|
-
${children || "/* Card content */"}
|
|
94
|
-
</CardContent>
|
|
95
|
-
</Card>`;
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
chart: {
|
|
99
|
-
imports: [
|
|
100
|
-
"import { LineChart, Line, BarChart, Bar, PieChart, Pie, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'"
|
|
101
|
-
],
|
|
102
|
-
render: (ctx) => {
|
|
103
|
-
const { properties } = ctx;
|
|
104
|
-
const chartType = properties.chartType || "line";
|
|
105
|
-
const chartMap = {
|
|
106
|
-
line: '<LineChart data={data}><CartesianGrid strokeDasharray="3 3" /><XAxis dataKey="name" /><YAxis /><Tooltip /><Legend /><Line type="monotone" dataKey="value" stroke="#8884d8" /></LineChart>',
|
|
107
|
-
bar: '<BarChart data={data}><CartesianGrid strokeDasharray="3 3" /><XAxis dataKey="name" /><YAxis /><Tooltip /><Legend /><Bar dataKey="value" fill="#8884d8" /></BarChart>',
|
|
108
|
-
pie: '<PieChart><Pie data={data} dataKey="value" nameKey="name" cx="50%" cy="50%" outerRadius={80} fill="#8884d8" label /></PieChart>',
|
|
109
|
-
trend: '<LineChart data={data}><Line type="monotone" dataKey="value" stroke="#8884d8" strokeWidth={2} dot={false} /></LineChart>'
|
|
110
|
-
};
|
|
111
|
-
const chart = chartMap[chartType] || chartMap.line;
|
|
112
|
-
return `<ResponsiveContainer width="100%" height={${properties.height || 300}}>
|
|
113
|
-
${chart}
|
|
114
|
-
</ResponsiveContainer>`;
|
|
115
|
-
},
|
|
116
|
-
dependencies: [{ name: "recharts", version: "^2.10.0" }]
|
|
117
|
-
},
|
|
118
|
-
tree: {
|
|
119
|
-
imports: [],
|
|
120
|
-
render: () => `<div className="tree-view">
|
|
121
|
-
{/* TODO: Implement tree component */}
|
|
122
|
-
</div>`
|
|
123
|
-
},
|
|
124
|
-
timeline: {
|
|
125
|
-
imports: [],
|
|
126
|
-
render: (ctx) => {
|
|
127
|
-
const { properties, children } = ctx;
|
|
128
|
-
const orientation = properties.orientation || "vertical";
|
|
129
|
-
return `<div className="relative ${orientation === "horizontal" ? "flex space-x-8" : "space-y-8"}">
|
|
130
|
-
${children || "/* Timeline items */"}
|
|
131
|
-
</div>`;
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
avatar: {
|
|
135
|
-
imports: ["import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'"],
|
|
136
|
-
render: (ctx) => {
|
|
137
|
-
const { properties } = ctx;
|
|
138
|
-
const size = properties.size === "large" ? "h-16 w-16" : properties.size === "small" ? "h-8 w-8" : "h-12 w-12";
|
|
139
|
-
return `<Avatar className="${size}">
|
|
140
|
-
<AvatarImage src={${properties.src || "user.avatar"}} alt="${properties.alt || "Avatar"}" />
|
|
141
|
-
<AvatarFallback>${properties.initials || "U"}</AvatarFallback>
|
|
142
|
-
</Avatar>`;
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
image: {
|
|
146
|
-
imports: [],
|
|
147
|
-
render: (ctx) => {
|
|
148
|
-
const { properties } = ctx;
|
|
149
|
-
return `<img
|
|
150
|
-
src={${properties.src || "imageSrc"}}
|
|
151
|
-
alt="${properties.alt || ""}"
|
|
152
|
-
className="${properties.objectFit === "cover" ? "object-cover" : "object-contain"} ${properties.lazy ? 'loading="lazy"' : ""}"
|
|
153
|
-
/>`;
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
// =====================================================================
|
|
157
|
-
// FORMS & INPUTS (11 types)
|
|
158
|
-
// =====================================================================
|
|
159
|
-
form: {
|
|
160
|
-
imports: ["import { Form } from '@/components/ui/form'"],
|
|
161
|
-
render: (ctx) => {
|
|
162
|
-
const { children } = ctx;
|
|
163
|
-
return `<Form {...form}>
|
|
164
|
-
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
|
|
165
|
-
${children || "/* Form fields */"}
|
|
166
|
-
</form>
|
|
167
|
-
</Form>`;
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
input: {
|
|
171
|
-
imports: ["import { Input } from '@/components/ui/input'", "import { Label } from '@/components/ui/label'"],
|
|
172
|
-
render: (ctx) => {
|
|
173
|
-
const { properties } = ctx;
|
|
174
|
-
return `<div className="grid w-full items-center gap-1.5">
|
|
175
|
-
${properties.label ? `<Label htmlFor="${properties.name || "input"}">${properties.label}${properties.required ? " *" : ""}</Label>` : ""}
|
|
176
|
-
<Input
|
|
177
|
-
type="${properties.type || "text"}"
|
|
178
|
-
id="${properties.name || "input"}"
|
|
179
|
-
placeholder="${properties.placeholder || ""}"
|
|
180
|
-
${properties.required ? "required" : ""}
|
|
181
|
-
${properties.disabled ? "disabled" : ""}
|
|
182
|
-
/>
|
|
183
|
-
${properties.helperText ? `<p className="text-sm text-muted-foreground">${properties.helperText}</p>` : ""}
|
|
184
|
-
</div>`;
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
textarea: {
|
|
188
|
-
imports: ["import { Textarea } from '@/components/ui/textarea'", "import { Label } from '@/components/ui/label'"],
|
|
189
|
-
render: (ctx) => {
|
|
190
|
-
const { properties } = ctx;
|
|
191
|
-
return `<div className="grid w-full gap-1.5">
|
|
192
|
-
${properties.label ? `<Label htmlFor="${properties.name || "textarea"}">${properties.label}</Label>` : ""}
|
|
193
|
-
<Textarea
|
|
194
|
-
id="${properties.name || "textarea"}"
|
|
195
|
-
placeholder="${properties.placeholder || ""}"
|
|
196
|
-
rows={${properties.rows || 4}}
|
|
197
|
-
${properties.required ? "required" : ""}
|
|
198
|
-
/>
|
|
199
|
-
</div>`;
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
select: {
|
|
203
|
-
imports: [
|
|
204
|
-
"import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'",
|
|
205
|
-
"import { Label } from '@/components/ui/label'"
|
|
206
|
-
],
|
|
207
|
-
render: (ctx) => {
|
|
208
|
-
const { properties } = ctx;
|
|
209
|
-
const options = properties.options || [];
|
|
210
|
-
return `<div className="grid w-full gap-1.5">
|
|
211
|
-
${properties.label ? `<Label>${properties.label}${properties.required ? " *" : ""}</Label>` : ""}
|
|
212
|
-
<Select>
|
|
213
|
-
<SelectTrigger>
|
|
214
|
-
<SelectValue placeholder="${properties.placeholder || "Select option"}" />
|
|
215
|
-
</SelectTrigger>
|
|
216
|
-
<SelectContent>
|
|
217
|
-
${options.map((opt) => `<SelectItem value="${opt}">${opt}</SelectItem>`).join("\n ")}
|
|
218
|
-
</SelectContent>
|
|
219
|
-
</Select>
|
|
220
|
-
</div>`;
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
checkbox: {
|
|
224
|
-
imports: ["import { Checkbox } from '@/components/ui/checkbox'", "import { Label } from '@/components/ui/label'"],
|
|
225
|
-
render: (ctx) => {
|
|
226
|
-
const { properties } = ctx;
|
|
227
|
-
return `<div className="flex items-center space-x-2">
|
|
228
|
-
<Checkbox id="${properties.name || "checkbox"}" ${properties.checked ? "checked" : ""} ${properties.disabled ? "disabled" : ""} />
|
|
229
|
-
${properties.label ? `<Label htmlFor="${properties.name || "checkbox"}">${properties.label}</Label>` : ""}
|
|
230
|
-
</div>`;
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
radio: {
|
|
234
|
-
imports: ["import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'", "import { Label } from '@/components/ui/label'"],
|
|
235
|
-
render: (ctx) => {
|
|
236
|
-
const { properties } = ctx;
|
|
237
|
-
const options = properties.options || [];
|
|
238
|
-
return `<div className="grid gap-2">
|
|
239
|
-
${properties.label ? `<Label>${properties.label}</Label>` : ""}
|
|
240
|
-
<RadioGroup>
|
|
241
|
-
${options.map((opt) => `<div className="flex items-center space-x-2">
|
|
242
|
-
<RadioGroupItem value="${opt}" id="${opt}" />
|
|
243
|
-
<Label htmlFor="${opt}">${opt}</Label>
|
|
244
|
-
</div>`).join("\n ")}
|
|
245
|
-
</RadioGroup>
|
|
246
|
-
</div>`;
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
slider: {
|
|
250
|
-
imports: ["import { Slider } from '@/components/ui/slider'", "import { Label } from '@/components/ui/label'"],
|
|
251
|
-
render: (ctx) => {
|
|
252
|
-
const { properties } = ctx;
|
|
253
|
-
return `<div className="grid gap-2">
|
|
254
|
-
${properties.label ? `<Label>${properties.label}</Label>` : ""}
|
|
255
|
-
<Slider
|
|
256
|
-
min={${properties.min || 0}}
|
|
257
|
-
max={${properties.max || 100}}
|
|
258
|
-
step={${properties.step || 1}}
|
|
259
|
-
defaultValue={[${properties.value || 50}]}
|
|
260
|
-
/>
|
|
261
|
-
${properties.showValue ? '<span className="text-sm text-muted-foreground">{value}</span>' : ""}
|
|
262
|
-
</div>`;
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
switch: {
|
|
266
|
-
imports: ["import { Switch } from '@/components/ui/switch'", "import { Label } from '@/components/ui/label'"],
|
|
267
|
-
render: (ctx) => {
|
|
268
|
-
const { properties } = ctx;
|
|
269
|
-
return `<div className="flex items-center space-x-2">
|
|
270
|
-
<Switch id="${properties.name || "switch"}" ${properties.checked ? "checked" : ""} ${properties.disabled ? "disabled" : ""} />
|
|
271
|
-
${properties.label ? `<Label htmlFor="${properties.name || "switch"}">${properties.label}</Label>` : ""}
|
|
272
|
-
</div>`;
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
autocomplete: {
|
|
276
|
-
imports: [
|
|
277
|
-
"import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from '@/components/ui/command'",
|
|
278
|
-
"import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'",
|
|
279
|
-
"import { Button } from '@/components/ui/button'"
|
|
280
|
-
],
|
|
281
|
-
render: (ctx) => {
|
|
282
|
-
const { properties } = ctx;
|
|
283
|
-
return `<Popover>
|
|
284
|
-
<PopoverTrigger asChild>
|
|
285
|
-
<Button variant="outline" role="combobox">
|
|
286
|
-
{selected || "${properties.placeholder || "Select..."}"}
|
|
287
|
-
</Button>
|
|
288
|
-
</PopoverTrigger>
|
|
289
|
-
<PopoverContent className="w-[200px] p-0">
|
|
290
|
-
<Command>
|
|
291
|
-
<CommandInput placeholder="${properties.label || "Search..."}" />
|
|
292
|
-
<CommandEmpty>No results found.</CommandEmpty>
|
|
293
|
-
<CommandGroup>
|
|
294
|
-
{/* Options */}
|
|
295
|
-
</CommandGroup>
|
|
296
|
-
</Command>
|
|
297
|
-
</PopoverContent>
|
|
298
|
-
</Popover>`;
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
datepicker: {
|
|
302
|
-
imports: [
|
|
303
|
-
"import { Calendar } from '@/components/ui/calendar'",
|
|
304
|
-
"import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'",
|
|
305
|
-
"import { Button } from '@/components/ui/button'",
|
|
306
|
-
"import { format } from 'date-fns'"
|
|
307
|
-
],
|
|
308
|
-
render: (ctx) => {
|
|
309
|
-
const { properties } = ctx;
|
|
310
|
-
return `<Popover>
|
|
311
|
-
<PopoverTrigger asChild>
|
|
312
|
-
<Button variant="outline">
|
|
313
|
-
{date ? format(date, "${properties.format || "PPP"}") : <span>Pick a date</span>}
|
|
314
|
-
</Button>
|
|
315
|
-
</PopoverTrigger>
|
|
316
|
-
<PopoverContent className="w-auto p-0">
|
|
317
|
-
<Calendar mode="single" selected={date} onSelect={setDate} initialFocus />
|
|
318
|
-
</PopoverContent>
|
|
319
|
-
</Popover>`;
|
|
320
|
-
},
|
|
321
|
-
dependencies: [{ name: "date-fns", version: "^3.0.0" }]
|
|
322
|
-
},
|
|
323
|
-
timepicker: {
|
|
324
|
-
imports: ["import { Input } from '@/components/ui/input'", "import { Label } from '@/components/ui/label'"],
|
|
325
|
-
render: (ctx) => {
|
|
326
|
-
const { properties } = ctx;
|
|
327
|
-
return `<div className="grid w-full gap-1.5">
|
|
328
|
-
${properties.label ? `<Label>${properties.label}</Label>` : ""}
|
|
329
|
-
<Input type="time" ${properties.required ? "required" : ""} />
|
|
330
|
-
</div>`;
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
// =====================================================================
|
|
334
|
-
// ACTIONS (5 types)
|
|
335
|
-
// =====================================================================
|
|
336
|
-
button: {
|
|
337
|
-
imports: ["import { Button } from '@/components/ui/button'"],
|
|
338
|
-
render: (ctx) => {
|
|
339
|
-
const { properties } = ctx;
|
|
340
|
-
const variants = {
|
|
341
|
-
primary: "default",
|
|
342
|
-
secondary: "secondary",
|
|
343
|
-
danger: "destructive",
|
|
344
|
-
ghost: "ghost",
|
|
345
|
-
link: "link"
|
|
346
|
-
};
|
|
347
|
-
const variant = variants[properties.variant || "primary"] || "default";
|
|
348
|
-
return `<Button
|
|
349
|
-
variant="${variant}"
|
|
350
|
-
size="${properties.size || "default"}"
|
|
351
|
-
${properties.disabled ? "disabled" : ""}
|
|
352
|
-
${properties.type ? `type="${properties.type}"` : ""}
|
|
353
|
-
>
|
|
354
|
-
${properties.icon ? `<${properties.icon} className="mr-2 h-4 w-4" />` : ""}
|
|
355
|
-
${properties.label || "Button"}
|
|
356
|
-
</Button>`;
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
"button-group": {
|
|
360
|
-
imports: [],
|
|
361
|
-
render: (ctx) => {
|
|
362
|
-
const { properties, children } = ctx;
|
|
363
|
-
const orientation = properties.orientation || "horizontal";
|
|
364
|
-
return `<div className="flex ${orientation === "vertical" ? "flex-col" : "flex-row"} gap-2">
|
|
365
|
-
${children || "/* Buttons */"}
|
|
366
|
-
</div>`;
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
link: {
|
|
370
|
-
imports: ["import Link from 'next/link'"],
|
|
371
|
-
render: (ctx) => {
|
|
372
|
-
const { properties } = ctx;
|
|
373
|
-
return `<Link
|
|
374
|
-
href="${properties.href || "#"}"
|
|
375
|
-
className="${properties.underline === false ? "no-underline" : "underline"}"
|
|
376
|
-
${properties.external ? 'target="_blank" rel="noopener noreferrer"' : ""}
|
|
377
|
-
>
|
|
378
|
-
${properties.label || "Link"}
|
|
379
|
-
</Link>`;
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
icon: {
|
|
383
|
-
imports: [],
|
|
384
|
-
render: (ctx) => {
|
|
385
|
-
const { properties } = ctx;
|
|
386
|
-
const sizeMap = { small: "h-4 w-4", medium: "h-6 w-6", large: "h-8 w-8" };
|
|
387
|
-
const size = sizeMap[properties.size || "medium"] || "h-6 w-6";
|
|
388
|
-
return `<${properties.name || "Icon"} className="${size} ${properties.color ? `text-${properties.color}` : ""}" />`;
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
menu: {
|
|
392
|
-
imports: [
|
|
393
|
-
"import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'"
|
|
394
|
-
],
|
|
395
|
-
render: (ctx) => {
|
|
396
|
-
const { children } = ctx;
|
|
397
|
-
return `<DropdownMenu>
|
|
398
|
-
<DropdownMenuTrigger>Menu</DropdownMenuTrigger>
|
|
399
|
-
<DropdownMenuContent>
|
|
400
|
-
${children || "/* Menu items */"}
|
|
401
|
-
</DropdownMenuContent>
|
|
402
|
-
</DropdownMenu>`;
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
// =====================================================================
|
|
406
|
-
// OVERLAYS & FEEDBACK (9 types)
|
|
407
|
-
// =====================================================================
|
|
408
|
-
modal: {
|
|
409
|
-
imports: [
|
|
410
|
-
"import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'"
|
|
411
|
-
],
|
|
412
|
-
render: (ctx) => {
|
|
413
|
-
const { properties, children } = ctx;
|
|
414
|
-
return `<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
|
415
|
-
<DialogContent className="${properties.size === "small" ? "sm:max-w-[425px]" : properties.size === "large" ? "sm:max-w-[725px]" : "sm:max-w-[525px]"}">
|
|
416
|
-
${properties.title ? `<DialogHeader>
|
|
417
|
-
<DialogTitle>${properties.title}</DialogTitle>
|
|
418
|
-
</DialogHeader>` : ""}
|
|
419
|
-
<div className="py-4">
|
|
420
|
-
${children || "/* Modal content */"}
|
|
421
|
-
</div>
|
|
422
|
-
${properties.footer ? "<DialogFooter>{/* Footer actions */}</DialogFooter>" : ""}
|
|
423
|
-
</DialogContent>
|
|
424
|
-
</Dialog>`;
|
|
425
|
-
}
|
|
426
|
-
},
|
|
427
|
-
dialog: {
|
|
428
|
-
imports: ["import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog'"],
|
|
429
|
-
render: (ctx) => {
|
|
430
|
-
const { properties } = ctx;
|
|
431
|
-
return `<AlertDialog>
|
|
432
|
-
<AlertDialogContent>
|
|
433
|
-
<AlertDialogHeader>
|
|
434
|
-
<AlertDialogTitle>${properties.title || "Alert"}</AlertDialogTitle>
|
|
435
|
-
<AlertDialogDescription>${properties.message || ""}</AlertDialogDescription>
|
|
436
|
-
</AlertDialogHeader>
|
|
437
|
-
<AlertDialogFooter>
|
|
438
|
-
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
439
|
-
<AlertDialogAction>Continue</AlertDialogAction>
|
|
440
|
-
</AlertDialogFooter>
|
|
441
|
-
</AlertDialogContent>
|
|
442
|
-
</AlertDialog>`;
|
|
443
|
-
}
|
|
444
|
-
},
|
|
445
|
-
drawer: {
|
|
446
|
-
imports: ["import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@/components/ui/sheet'"],
|
|
447
|
-
render: (ctx) => {
|
|
448
|
-
const { properties, children } = ctx;
|
|
449
|
-
return `<Sheet>
|
|
450
|
-
<SheetContent side="${properties.position || "right"}">
|
|
451
|
-
<SheetHeader>
|
|
452
|
-
<SheetTitle>${properties.title || ""}</SheetTitle>
|
|
453
|
-
</SheetHeader>
|
|
454
|
-
<div className="py-4">
|
|
455
|
-
${children || "/* Drawer content */"}
|
|
456
|
-
</div>
|
|
457
|
-
</SheetContent>
|
|
458
|
-
</Sheet>`;
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
popover: {
|
|
462
|
-
imports: ["import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'"],
|
|
463
|
-
render: (ctx) => {
|
|
464
|
-
const { children } = ctx;
|
|
465
|
-
return `<Popover>
|
|
466
|
-
<PopoverTrigger>Trigger</PopoverTrigger>
|
|
467
|
-
<PopoverContent>
|
|
468
|
-
${children || "Popover content"}
|
|
469
|
-
</PopoverContent>
|
|
470
|
-
</Popover>`;
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
|
-
tooltip: {
|
|
474
|
-
imports: ["import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'"],
|
|
475
|
-
render: (ctx) => {
|
|
476
|
-
const { properties } = ctx;
|
|
477
|
-
return `<TooltipProvider>
|
|
478
|
-
<Tooltip>
|
|
479
|
-
<TooltipTrigger>Hover</TooltipTrigger>
|
|
480
|
-
<TooltipContent>
|
|
481
|
-
<p>${properties.content || "Tooltip content"}</p>
|
|
482
|
-
</TooltipContent>
|
|
483
|
-
</Tooltip>
|
|
484
|
-
</TooltipProvider>`;
|
|
485
|
-
}
|
|
486
|
-
},
|
|
487
|
-
alert: {
|
|
488
|
-
imports: ["import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'"],
|
|
489
|
-
render: (ctx) => {
|
|
490
|
-
const { properties } = ctx;
|
|
491
|
-
return `<Alert variant="${properties.variant || "default"}">
|
|
492
|
-
${properties.title ? `<AlertTitle>${properties.title}</AlertTitle>` : ""}
|
|
493
|
-
<AlertDescription>${properties.message || ""}</AlertDescription>
|
|
494
|
-
</Alert>`;
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
snackbar: {
|
|
498
|
-
imports: ["import { useToast } from '@/components/ui/use-toast'"],
|
|
499
|
-
render: (ctx) => {
|
|
500
|
-
const { properties } = ctx;
|
|
501
|
-
return `toast({
|
|
502
|
-
title: "${properties.message || "Notification"}",
|
|
503
|
-
duration: ${properties.duration || 3e3},
|
|
504
|
-
})`;
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
badge: {
|
|
508
|
-
imports: ["import { Badge } from '@/components/ui/badge'"],
|
|
509
|
-
render: (ctx) => {
|
|
510
|
-
const { properties } = ctx;
|
|
511
|
-
return `<Badge variant="${properties.variant || "default"}">${properties.content || ""}</Badge>`;
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
spinner: {
|
|
515
|
-
imports: [],
|
|
516
|
-
render: (ctx) => {
|
|
517
|
-
const { properties } = ctx;
|
|
518
|
-
const sizeMap = { small: "h-4 w-4", medium: "h-8 w-8", large: "h-12 w-12" };
|
|
519
|
-
const size = sizeMap[properties.size || "medium"] || "h-8 w-8";
|
|
520
|
-
return `<div className="flex items-center justify-center">
|
|
521
|
-
<div className="${size} animate-spin rounded-full border-b-2 border-gray-900"></div>
|
|
522
|
-
</div>`;
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
// =====================================================================
|
|
526
|
-
// NAVIGATION (5 types)
|
|
527
|
-
// =====================================================================
|
|
528
|
-
tabs: {
|
|
529
|
-
imports: ["import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'"],
|
|
530
|
-
render: (ctx) => {
|
|
531
|
-
const { properties, children } = ctx;
|
|
532
|
-
const sections = properties.sections || ["tab1", "tab2"];
|
|
533
|
-
return `<Tabs defaultValue="${sections[0]}">
|
|
534
|
-
<TabsList>
|
|
535
|
-
${sections.map((section) => `<TabsTrigger value="${section}">${section}</TabsTrigger>`).join("\n ")}
|
|
536
|
-
</TabsList>
|
|
537
|
-
${sections.map((section) => `<TabsContent value="${section}">
|
|
538
|
-
{/* ${section} content */}
|
|
539
|
-
</TabsContent>`).join("\n ")}
|
|
540
|
-
</Tabs>`;
|
|
541
|
-
}
|
|
542
|
-
},
|
|
543
|
-
breadcrumb: {
|
|
544
|
-
imports: [],
|
|
545
|
-
render: (ctx) => {
|
|
546
|
-
return `<nav className="flex" aria-label="Breadcrumb">
|
|
547
|
-
<ol className="inline-flex items-center space-x-1">
|
|
548
|
-
{/* Breadcrumb items */}
|
|
549
|
-
</ol>
|
|
550
|
-
</nav>`;
|
|
551
|
-
}
|
|
552
|
-
},
|
|
553
|
-
navbar: {
|
|
554
|
-
imports: [],
|
|
555
|
-
render: (ctx) => {
|
|
556
|
-
const { properties, children } = ctx;
|
|
557
|
-
return `<nav className="${properties.sticky ? "sticky top-0" : ""} bg-background border-b">
|
|
558
|
-
<div className="container flex h-16 items-center justify-between">
|
|
559
|
-
${children || "/* Navigation items */"}
|
|
560
|
-
</div>
|
|
561
|
-
</nav>`;
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
sidebar: {
|
|
565
|
-
imports: [],
|
|
566
|
-
render: (ctx) => {
|
|
567
|
-
const { properties, children } = ctx;
|
|
568
|
-
return `<aside className="w-${properties.width || 64} border-r ${properties.position === "right" ? "order-last" : ""}">
|
|
569
|
-
<div className="h-full px-3 py-4">
|
|
570
|
-
${children || "/* Sidebar items */"}
|
|
571
|
-
</div>
|
|
572
|
-
</aside>`;
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
|
-
pagination: {
|
|
576
|
-
imports: [
|
|
577
|
-
"import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from '@/components/ui/pagination'"
|
|
578
|
-
],
|
|
579
|
-
render: (ctx) => {
|
|
580
|
-
return `<Pagination>
|
|
581
|
-
<PaginationContent>
|
|
582
|
-
<PaginationItem>
|
|
583
|
-
<PaginationPrevious href="#" />
|
|
584
|
-
</PaginationItem>
|
|
585
|
-
{/* Page numbers */}
|
|
586
|
-
<PaginationItem>
|
|
587
|
-
<PaginationNext href="#" />
|
|
588
|
-
</PaginationItem>
|
|
589
|
-
</PaginationContent>
|
|
590
|
-
</Pagination>`;
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
// =====================================================================
|
|
594
|
-
// LAYOUT (6 types)
|
|
595
|
-
// =====================================================================
|
|
596
|
-
accordion: {
|
|
597
|
-
imports: ["import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'"],
|
|
598
|
-
render: (ctx) => {
|
|
599
|
-
const { children } = ctx;
|
|
600
|
-
return `<Accordion type="single" collapsible>
|
|
601
|
-
${children || "/* Accordion items */"}
|
|
602
|
-
</Accordion>`;
|
|
603
|
-
}
|
|
604
|
-
},
|
|
605
|
-
carousel: {
|
|
606
|
-
imports: [],
|
|
607
|
-
render: (ctx) => {
|
|
608
|
-
const { children } = ctx;
|
|
609
|
-
return `<div className="relative">
|
|
610
|
-
{/* Carousel implementation */}
|
|
611
|
-
${children || ""}
|
|
612
|
-
</div>`;
|
|
613
|
-
}
|
|
614
|
-
},
|
|
615
|
-
container: {
|
|
616
|
-
imports: [],
|
|
617
|
-
render: (ctx) => {
|
|
618
|
-
const { properties, children } = ctx;
|
|
619
|
-
const layout = properties.layout || "vertical";
|
|
620
|
-
const className = layout === "horizontal" ? "flex flex-row" : layout === "grid" ? "grid" : "flex flex-col";
|
|
621
|
-
return `<div className="${className} ${properties.gap ? `gap-${properties.gap}` : ""} ${properties.scrollable ? "overflow-auto" : ""}">
|
|
622
|
-
${children || "/* Container content */"}
|
|
623
|
-
</div>`;
|
|
624
|
-
}
|
|
625
|
-
},
|
|
626
|
-
divider: {
|
|
627
|
-
imports: ["import { Separator } from '@/components/ui/separator'"],
|
|
628
|
-
render: (ctx) => {
|
|
629
|
-
const { properties } = ctx;
|
|
630
|
-
return `<Separator orientation="${properties.orientation || "horizontal"}" />`;
|
|
631
|
-
}
|
|
632
|
-
},
|
|
633
|
-
header: {
|
|
634
|
-
imports: [],
|
|
635
|
-
render: (ctx) => {
|
|
636
|
-
const { properties, children } = ctx;
|
|
637
|
-
return `<header>
|
|
638
|
-
${properties.title ? `<h1 className="text-3xl font-bold">${properties.title}</h1>` : ""}
|
|
639
|
-
${properties.subtitle ? `<p className="text-muted-foreground">${properties.subtitle}</p>` : ""}
|
|
640
|
-
${children || ""}
|
|
641
|
-
</header>`;
|
|
642
|
-
}
|
|
643
|
-
},
|
|
644
|
-
footer: {
|
|
645
|
-
imports: [],
|
|
646
|
-
render: (ctx) => {
|
|
647
|
-
const { properties, children } = ctx;
|
|
648
|
-
return `<footer className="${properties.sticky ? "sticky bottom-0" : ""} border-t bg-background">
|
|
649
|
-
<div className="container py-6">
|
|
650
|
-
${children || "/* Footer content */"}
|
|
651
|
-
${properties.copyright ? `<p className="text-sm text-muted-foreground">${properties.copyright}</p>` : ""}
|
|
652
|
-
</div>
|
|
653
|
-
</footer>`;
|
|
654
|
-
}
|
|
655
|
-
},
|
|
656
|
-
// =====================================================================
|
|
657
|
-
// PROGRESS (2 types)
|
|
658
|
-
// =====================================================================
|
|
659
|
-
"progress-bar": {
|
|
660
|
-
imports: ["import { Progress } from '@/components/ui/progress'"],
|
|
661
|
-
render: (ctx) => {
|
|
662
|
-
const { properties } = ctx;
|
|
663
|
-
return `<div className="space-y-2">
|
|
664
|
-
${properties.label ? `<div className="flex justify-between text-sm"><span>Progress</span><span>{${properties.value || 0}}%</span></div>` : ""}
|
|
665
|
-
<Progress value={${properties.value || 0}} max={${properties.max || 100}} />
|
|
666
|
-
</div>`;
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
"progress-circle": {
|
|
670
|
-
imports: [],
|
|
671
|
-
render: (ctx) => {
|
|
672
|
-
const { properties } = ctx;
|
|
673
|
-
const size = properties.size === "large" ? "h-32 w-32" : properties.size === "small" ? "h-16 w-16" : "h-24 w-24";
|
|
674
|
-
return `<div className="${size} relative">
|
|
675
|
-
<svg className="rotate-[-90deg]" viewBox="0 0 100 100">
|
|
676
|
-
<circle cx="50" cy="50" r="40" stroke="currentColor" strokeWidth="${properties.thickness || 4}" fill="none" className="text-muted" />
|
|
677
|
-
<circle cx="50" cy="50" r="40" stroke="currentColor" strokeWidth="${properties.thickness || 4}" fill="none" strokeDasharray="251.2" strokeDashoffset={251.2 - (251.2 * ${properties.value || 0}) / 100} className="text-primary transition-all" />
|
|
678
|
-
</svg>
|
|
679
|
-
${properties.label ? '<div className="absolute inset-0 flex items-center justify-center text-lg font-bold">{value}%</div>' : ""}
|
|
680
|
-
</div>`;
|
|
681
|
-
}
|
|
682
|
-
},
|
|
683
|
-
// =====================================================================
|
|
684
|
-
// SPECIALIZED (2 types)
|
|
685
|
-
// =====================================================================
|
|
686
|
-
searchBar: {
|
|
687
|
-
imports: ["import { Input } from '@/components/ui/input'", "import { Search } from 'lucide-react'"],
|
|
688
|
-
render: (ctx) => {
|
|
689
|
-
const { properties } = ctx;
|
|
690
|
-
return `<div className="relative">
|
|
691
|
-
<Search className="absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
|
|
692
|
-
<Input
|
|
693
|
-
type="search"
|
|
694
|
-
placeholder="${properties.placeholder || "Search..."}"
|
|
695
|
-
className="pl-8"
|
|
696
|
-
${properties.autofocus ? "autoFocus" : ""}
|
|
697
|
-
/>
|
|
698
|
-
</div>`;
|
|
699
|
-
}
|
|
700
|
-
},
|
|
701
|
-
filterPanel: {
|
|
702
|
-
imports: ["import { Card } from '@/components/ui/card'"],
|
|
703
|
-
render: (ctx) => {
|
|
704
|
-
const { properties, children } = ctx;
|
|
705
|
-
return `<Card className="${properties.position === "sidebar" ? "w-64" : "w-full"} ${properties.collapsible ? "collapsible" : ""}">
|
|
706
|
-
<div className="p-4 space-y-4">
|
|
707
|
-
<h3 className="font-semibold">Filters</h3>
|
|
708
|
-
${children || "/* Filter controls */"}
|
|
709
|
-
</div>
|
|
710
|
-
</Card>`;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
};
|
|
715
|
-
var stdin_default = shadcnAdapter;
|
|
716
|
-
export {
|
|
717
|
-
stdin_default as default,
|
|
718
|
-
shadcnAdapter
|
|
719
|
-
};
|