Skip to content

Commit bed3b60

Browse files
feat(livePreview): (#16)
* feat(livePreview): * enable first version React live preview * rewrite struct examples * add factory to best developer way to add more examples * chore(livePreview): fixed transformImports * chore(vercel): fix all typescript build problems
1 parent db33a8e commit bed3b60

27 files changed

Lines changed: 2806 additions & 986 deletions

components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/app/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "papi-simulator",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"author": "codingsh <codinsh@pm.me>",
55
"private": true,
66
"scripts": {
@@ -10,19 +10,32 @@
1010
"lint": "next lint"
1111
},
1212
"dependencies": {
13+
"@babel/standalone": "^7.27.0",
1314
"@monaco-editor/react": "^4.7.0",
1415
"@polkadot/api": "^15.9.2",
16+
"@radix-ui/react-slot": "^1.2.0",
17+
"@radix-ui/react-toggle": "^1.1.6",
18+
"@types/babel__standalone": "^7.1.9",
1519
"@types/webpack": "^5.28.5",
1620
"biome": "^0.3.3",
21+
"class-variance-authority": "^0.7.1",
1722
"classnames": "^2.5.1",
18-
"lucide-react": "^0.487.0",
23+
"clsx": "^2.1.1",
24+
"lucide-react": "^0.501.0",
1925
"monaco-editor": "^0.52.2",
2026
"monaco-editor-webpack-plugin": "^7.1.0",
2127
"next": "15.2.4",
2228
"polkadot-api": "^1.9.13",
29+
"prettier": "^3.5.3",
2330
"react": "^19.0.0",
2431
"react-dom": "^19.0.0",
32+
"react-error-boundary": "^5.0.0",
33+
"react-icons": "^5.5.0",
34+
"react-jsx": "^1.0.0",
35+
"recharts": "^2.15.3",
2536
"rxjs": "^7.8.2",
37+
"tailwind-merge": "^3.2.0",
38+
"tw-animate-css": "^1.2.5",
2639
"webpack": "^5.99.6"
2740
},
2841
"devDependencies": {

src/app/globals.css

Lines changed: 116 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
@import "tailwindcss";
2+
@import "tw-animate-css";
3+
4+
@custom-variant dark (&:is(.dark *));
25

36
:root {
4-
--background: #ffffff;
57
--surface: #f7f7f9;
68
--surface-variant: #eeeef2;
79

810
--text-primary: #18181b;
911
--text-secondary: #52525b;
1012
--text-tertiary: #71717a;
1113

12-
--border: #e4e4e7;
14+
--border: oklch(0.922 0 0);
1315
--divider: #f1f1f4;
1416

1517
--success: #22c55e;
@@ -29,6 +31,37 @@
2931

3032
--font-sans: var(--font-geist-sans);
3133
--font-mono: var(--font-geist-mono);
34+
--radius: 0.625rem;
35+
--background: oklch(1 0 0);
36+
--foreground: oklch(0.145 0 0);
37+
--card: oklch(1 0 0);
38+
--card-foreground: oklch(0.145 0 0);
39+
--popover: oklch(1 0 0);
40+
--popover-foreground: oklch(0.145 0 0);
41+
--primary: oklch(0.205 0 0);
42+
--primary-foreground: oklch(0.985 0 0);
43+
--secondary: oklch(0.97 0 0);
44+
--secondary-foreground: oklch(0.205 0 0);
45+
--muted: oklch(0.97 0 0);
46+
--muted-foreground: oklch(0.556 0 0);
47+
--accent: oklch(0.97 0 0);
48+
--accent-foreground: oklch(0.205 0 0);
49+
--destructive: oklch(0.577 0.245 27.325);
50+
--input: oklch(0.922 0 0);
51+
--ring: oklch(0.708 0 0);
52+
--chart-1: oklch(0.646 0.222 41.116);
53+
--chart-2: oklch(0.6 0.118 184.704);
54+
--chart-3: oklch(0.398 0.07 227.392);
55+
--chart-4: oklch(0.828 0.189 84.429);
56+
--chart-5: oklch(0.769 0.188 70.08);
57+
--sidebar: oklch(0.985 0 0);
58+
--sidebar-foreground: oklch(0.145 0 0);
59+
--sidebar-primary: oklch(0.205 0 0);
60+
--sidebar-primary-foreground: oklch(0.985 0 0);
61+
--sidebar-accent: oklch(0.97 0 0);
62+
--sidebar-accent-foreground: oklch(0.205 0 0);
63+
--sidebar-border: oklch(0.922 0 0);
64+
--sidebar-ring: oklch(0.708 0 0);
3265
}
3366

3467
[data-theme="dark"] {
@@ -255,3 +288,84 @@ body {
255288
padding: 12px !important;
256289
}
257290
}
291+
292+
@theme inline {
293+
--radius-sm: calc(var(--radius) - 4px);
294+
--radius-md: calc(var(--radius) - 2px);
295+
--radius-lg: var(--radius);
296+
--radius-xl: calc(var(--radius) + 4px);
297+
--color-background: var(--background);
298+
--color-foreground: var(--foreground);
299+
--color-card: var(--card);
300+
--color-card-foreground: var(--card-foreground);
301+
--color-popover: var(--popover);
302+
--color-popover-foreground: var(--popover-foreground);
303+
--color-primary: var(--primary);
304+
--color-primary-foreground: var(--primary-foreground);
305+
--color-secondary: var(--secondary);
306+
--color-secondary-foreground: var(--secondary-foreground);
307+
--color-muted: var(--muted);
308+
--color-muted-foreground: var(--muted-foreground);
309+
--color-accent: var(--accent);
310+
--color-accent-foreground: var(--accent-foreground);
311+
--color-destructive: var(--destructive);
312+
--color-border: var(--border);
313+
--color-input: var(--input);
314+
--color-ring: var(--ring);
315+
--color-chart-1: var(--chart-1);
316+
--color-chart-2: var(--chart-2);
317+
--color-chart-3: var(--chart-3);
318+
--color-chart-4: var(--chart-4);
319+
--color-chart-5: var(--chart-5);
320+
--color-sidebar: var(--sidebar);
321+
--color-sidebar-foreground: var(--sidebar-foreground);
322+
--color-sidebar-primary: var(--sidebar-primary);
323+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
324+
--color-sidebar-accent: var(--sidebar-accent);
325+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
326+
--color-sidebar-border: var(--sidebar-border);
327+
--color-sidebar-ring: var(--sidebar-ring);
328+
}
329+
330+
.dark {
331+
--background: oklch(0.145 0 0);
332+
--foreground: oklch(0.985 0 0);
333+
--card: oklch(0.205 0 0);
334+
--card-foreground: oklch(0.985 0 0);
335+
--popover: oklch(0.205 0 0);
336+
--popover-foreground: oklch(0.985 0 0);
337+
--primary: oklch(0.922 0 0);
338+
--primary-foreground: oklch(0.205 0 0);
339+
--secondary: oklch(0.269 0 0);
340+
--secondary-foreground: oklch(0.985 0 0);
341+
--muted: oklch(0.269 0 0);
342+
--muted-foreground: oklch(0.708 0 0);
343+
--accent: oklch(0.269 0 0);
344+
--accent-foreground: oklch(0.985 0 0);
345+
--destructive: oklch(0.704 0.191 22.216);
346+
--border: oklch(1 0 0 / 10%);
347+
--input: oklch(1 0 0 / 15%);
348+
--ring: oklch(0.556 0 0);
349+
--chart-1: oklch(0.488 0.243 264.376);
350+
--chart-2: oklch(0.696 0.17 162.48);
351+
--chart-3: oklch(0.769 0.188 70.08);
352+
--chart-4: oklch(0.627 0.265 303.9);
353+
--chart-5: oklch(0.645 0.246 16.439);
354+
--sidebar: oklch(0.205 0 0);
355+
--sidebar-foreground: oklch(0.985 0 0);
356+
--sidebar-primary: oklch(0.488 0.243 264.376);
357+
--sidebar-primary-foreground: oklch(0.985 0 0);
358+
--sidebar-accent: oklch(0.269 0 0);
359+
--sidebar-accent-foreground: oklch(0.985 0 0);
360+
--sidebar-border: oklch(1 0 0 / 10%);
361+
--sidebar-ring: oklch(0.556 0 0);
362+
}
363+
364+
@layer base {
365+
* {
366+
@apply border-border outline-ring/50;
367+
}
368+
body {
369+
@apply bg-background text-foreground;
370+
}
371+
}

0 commit comments

Comments
 (0)