Skip to content

Commit 6284e05

Browse files
authored
Merge pull request #125 from x0k/playground-update
Playground update
2 parents 143c0cd + 14446e5 commit 6284e05

File tree

97 files changed

+1591
-930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1591
-930
lines changed

.changeset/smooth-donkeys-play.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"playground2": major
3+
---
4+
5+
- Store playground state in a URL hash
6+
- Migration to shadcn-svelte UI

apps/playground2/components.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://next.shadcn-svelte.com/schema.json",
3+
"tailwind": {
4+
"css": "src/app.css",
5+
"baseColor": "neutral"
6+
},
7+
"aliases": {
8+
"components": "$lib/components",
9+
"utils": "$lib/utils",
10+
"ui": "$lib/components/ui",
11+
"hooks": "$lib/hooks",
12+
"lib": "$lib"
13+
},
14+
"typescript": true,
15+
"registry": "https://next.shadcn-svelte.com/registry"
16+
}

apps/playground2/index.html

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,16 @@
66
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
88
<title>SJSF Playground</title>
9-
<script>
10-
if (
11-
localStorage.theme === "dark" ||
12-
(!("theme" in localStorage) &&
13-
window.matchMedia("(prefers-color-scheme: dark)").matches)
14-
) {
15-
document.documentElement.classList.add("dark");
16-
} else {
17-
document.documentElement.classList.remove("dark");
18-
}
9+
<script type="module">
10+
import { themeManager } from '@/theme.svelte.js'
11+
12+
themeManager.sync()
1913
</script>
20-
<script data-goatcounter="https://sjsf.counter.x0k.dev/count" async
21-
src="//sjsf.counter.x0k.dev/count.js"></script>
14+
<script data-goatcounter="https://sjsf.counter.x0k.dev/count" async src="//sjsf.counter.x0k.dev/count.js"></script>
2215
</head>
2316

2417
<body>
25-
<div id="app"></div>
18+
<div id="app" style="display: contents;"></div>
2619
<script type="module" src="/src/main.ts"></script>
2720
</body>
2821

apps/playground2/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"@codemirror/lang-json": "^6.0.1",
1414
"@codemirror/state": "^6.5.2",
1515
"@codemirror/view": "^6.37.1",
16-
"@lucide/svelte": "^0.511.0",
1716
"@sjsf/ajv8-validator": "workspace:*",
1817
"@sjsf/basic-theme": "workspace:*",
1918
"@sjsf/cfworker-validator": "workspace:*",
@@ -34,11 +33,18 @@
3433
"svelte-exmarkdown": "^5.0.1"
3534
},
3635
"devDependencies": {
36+
"@internationalized/date": "^3.8.1",
37+
"@lucide/svelte": "^0.511.0",
3738
"@sveltejs/vite-plugin-svelte": "catalog:",
3839
"@tailwindcss/vite": "catalog:",
3940
"@tsconfig/svelte": "catalog:",
41+
"bits-ui": "^2.4.1",
42+
"clsx": "^2.1.1",
4043
"svelte": "catalog:",
4144
"svelte-check": "catalog:",
42-
"tailwindcss": "catalog:next"
45+
"tailwind-merge": "^3.3.0",
46+
"tailwind-variants": "^1.0.0",
47+
"tailwindcss": "catalog:next",
48+
"tw-animate-css": "^1.3.3"
4349
}
4450
}

apps/playground2/src/app.css

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,121 @@
11
@import "tailwindcss";
22

3-
@custom-variant dark (&:where(.dark, .dark *));
3+
@import "tw-animate-css";
4+
5+
@custom-variant dark (&:is(.dark *));
6+
7+
:root {
8+
--radius: 0.625rem;
9+
--background: oklch(1 0 0);
10+
--foreground: oklch(0.145 0 0);
11+
--card: oklch(1 0 0);
12+
--card-foreground: oklch(0.145 0 0);
13+
--popover: oklch(1 0 0);
14+
--popover-foreground: oklch(0.145 0 0);
15+
--primary: oklch(0.205 0 0);
16+
--primary-foreground: oklch(0.985 0 0);
17+
--secondary: oklch(0.97 0 0);
18+
--secondary-foreground: oklch(0.205 0 0);
19+
--muted: oklch(0.97 0 0);
20+
--muted-foreground: oklch(0.556 0 0);
21+
--accent: oklch(0.97 0 0);
22+
--accent-foreground: oklch(0.205 0 0);
23+
--destructive: oklch(0.577 0.245 27.325);
24+
--border: oklch(0.922 0 0);
25+
--input: oklch(0.922 0 0);
26+
--ring: oklch(0.708 0 0);
27+
--chart-1: oklch(0.646 0.222 41.116);
28+
--chart-2: oklch(0.6 0.118 184.704);
29+
--chart-3: oklch(0.398 0.07 227.392);
30+
--chart-4: oklch(0.828 0.189 84.429);
31+
--chart-5: oklch(0.769 0.188 70.08);
32+
--sidebar: oklch(0.985 0 0);
33+
--sidebar-foreground: oklch(0.145 0 0);
34+
--sidebar-primary: oklch(0.205 0 0);
35+
--sidebar-primary-foreground: oklch(0.985 0 0);
36+
--sidebar-accent: oklch(0.97 0 0);
37+
--sidebar-accent-foreground: oklch(0.205 0 0);
38+
--sidebar-border: oklch(0.922 0 0);
39+
--sidebar-ring: oklch(0.708 0 0);
40+
}
41+
42+
.dark {
43+
--background: oklch(0.145 0 0);
44+
--foreground: oklch(0.985 0 0);
45+
--card: oklch(0.205 0 0);
46+
--card-foreground: oklch(0.985 0 0);
47+
--popover: oklch(0.205 0 0);
48+
--popover-foreground: oklch(0.985 0 0);
49+
--primary: oklch(0.922 0 0);
50+
--primary-foreground: oklch(0.205 0 0);
51+
--secondary: oklch(0.269 0 0);
52+
--secondary-foreground: oklch(0.985 0 0);
53+
--muted: oklch(0.269 0 0);
54+
--muted-foreground: oklch(0.708 0 0);
55+
--accent: oklch(0.269 0 0);
56+
--accent-foreground: oklch(0.985 0 0);
57+
--destructive: oklch(0.704 0.191 22.216);
58+
--border: oklch(1 0 0 / 10%);
59+
--input: oklch(1 0 0 / 15%);
60+
--ring: oklch(0.556 0 0);
61+
--chart-1: oklch(0.488 0.243 264.376);
62+
--chart-2: oklch(0.696 0.17 162.48);
63+
--chart-3: oklch(0.769 0.188 70.08);
64+
--chart-4: oklch(0.627 0.265 303.9);
65+
--chart-5: oklch(0.645 0.246 16.439);
66+
--sidebar: oklch(0.205 0 0);
67+
--sidebar-foreground: oklch(0.985 0 0);
68+
--sidebar-primary: oklch(0.488 0.243 264.376);
69+
--sidebar-primary-foreground: oklch(0.985 0 0);
70+
--sidebar-accent: oklch(0.269 0 0);
71+
--sidebar-accent-foreground: oklch(0.985 0 0);
72+
--sidebar-border: oklch(1 0 0 / 10%);
73+
--sidebar-ring: oklch(0.556 0 0);
74+
}
75+
76+
@theme inline {
77+
--radius-sm: calc(var(--radius) - 4px);
78+
--radius-md: calc(var(--radius) - 2px);
79+
--radius-lg: var(--radius);
80+
--radius-xl: calc(var(--radius) + 4px);
81+
--color-background: var(--background);
82+
--color-foreground: var(--foreground);
83+
--color-card: var(--card);
84+
--color-card-foreground: var(--card-foreground);
85+
--color-popover: var(--popover);
86+
--color-popover-foreground: var(--popover-foreground);
87+
--color-primary: var(--primary);
88+
--color-primary-foreground: var(--primary-foreground);
89+
--color-secondary: var(--secondary);
90+
--color-secondary-foreground: var(--secondary-foreground);
91+
--color-muted: var(--muted);
92+
--color-muted-foreground: var(--muted-foreground);
93+
--color-accent: var(--accent);
94+
--color-accent-foreground: var(--accent-foreground);
95+
--color-destructive: var(--destructive);
96+
--color-border: var(--border);
97+
--color-input: var(--input);
98+
--color-ring: var(--ring);
99+
--color-chart-1: var(--chart-1);
100+
--color-chart-2: var(--chart-2);
101+
--color-chart-3: var(--chart-3);
102+
--color-chart-4: var(--chart-4);
103+
--color-chart-5: var(--chart-5);
104+
--color-sidebar: var(--sidebar);
105+
--color-sidebar-foreground: var(--sidebar-foreground);
106+
--color-sidebar-primary: var(--sidebar-primary);
107+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
108+
--color-sidebar-accent: var(--sidebar-accent);
109+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
110+
--color-sidebar-border: var(--sidebar-border);
111+
--color-sidebar-ring: var(--sidebar-ring);
112+
}
113+
114+
@layer base {
115+
* {
116+
@apply border-border outline-ring/50;
117+
}
118+
body {
119+
@apply bg-background text-foreground;
120+
}
121+
}

0 commit comments

Comments
 (0)