11---
22import { Code } from " astro:components" ;
33import * as prettier from " prettier" ;
4+ import lucideIcons from " ../icons/lucide?raw" ;
45
56interface Props {
67 title? : string ;
@@ -141,7 +142,8 @@ function generateStackBlitzProject(
141142 " index.html" : generateIndexHtml (),
142143 " src/theme.css" : generateThemeCss (),
143144 " src/app.tsx" : generateAppTsx (),
144- " src/index.tsx" : generateIndexTsx (code , imports , sections ),
145+ " src/index.tsx" : generateIndexTsx (code ),
146+ " src/icons.tsx" : lucideIcons
145147 },
146148 template: " node" as const ,
147149 title: " CxJS Example" ,
@@ -154,18 +156,20 @@ function generatePackageJson() {
154156 {
155157 name: " cxjs-example" ,
156158 version: " 1.0.0" ,
159+ private: true ,
157160 type: " module" ,
158161 scripts: { dev: " vite" , build: " vite build" },
159162 dependencies: {
160163 cx: " latest" ,
161164 " cx-react" : " latest" ,
162- " cx-theme-space-blue" : " latest" ,
163- react: " ^18.2.0" ,
164- " react-dom" : " ^18.2.0" ,
165+ " cx-theme-variables" : " latest" ,
166+ react: " ^19.2.0" ,
167+ " react-dom" : " ^19.2.0" ,
168+ " lucide" : " ^0.562.0" ,
165169 },
166170 devDependencies: {
167- " @types/react" : " ^18 .2.0" ,
168- " @types/react-dom" : " ^18 .2.0" ,
171+ " @types/react" : " ^19 .2.0" ,
172+ " @types/react-dom" : " ^19 .2.0" ,
169173 typescript: " ^5.0.0" ,
170174 vite: " ^5.0.0" ,
171175 },
@@ -218,8 +222,9 @@ function generateIndexHtml() {
218222 <meta charset="UTF-8" />
219223 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
220224 <title>CxJS Example</title>
225+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
221226 <style>
222- html, body { height: 100%; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
227+ html, body { height: 100%; margin: 0; padding: 0; }
223228 #app { }
224229 .app-frame {
225230 min-height: 100px;
@@ -239,18 +244,22 @@ function generateIndexHtml() {
239244}
240245
241246function generateThemeCss() {
242- return ` @import "cx-theme-space-blue /dist/reset.css";
243- @import "cx-theme-space-blue /dist/widgets.css";
244- @import "cx-theme-space-blue /dist/charts.css";
245- @import "cx-theme-space-blue /dist/svg.css"; ` ;
247+ return ` @import "cx-theme-variables /dist/reset.css";
248+ @import "cx-theme-variables /dist/widgets.css";
249+ @import "cx-theme-variables /dist/charts.css";
250+ @import "cx-theme-variables /dist/svg.css"; ` ;
246251}
247252
248253function generateAppTsx() {
249254 return ` import "./theme.css";
250255import { startAppLoop } from "cx/ui";
251256import { Store } from "cx/data";
257+ import { renderThemeVariables, docsLightPreset } from "cx-theme-variables";
258+ import "./icons";
252259import Content from "./index";
253260
261+ renderThemeVariables(docsLightPreset);
262+
254263const store = new Store();
255264
256265startAppLoop(
@@ -281,6 +290,7 @@ function generateIndexTsx(fullCode: string) {
281290 return fullCode
282291 .split (" \n " )
283292 .filter ((line ) => ! line .trim ().match (/ ^ \/\/ \s * @(model| controller| components| index)(-end)? $ / ))
293+ .filter ((line ) => ! line .trim ().match (/ ^ import\s + ['"] . * icons\/ lucide. * ['"] ;? \s * $ / ))
284294 .join (" \n " );
285295}
286296
0 commit comments