From 01efe921c878509e47f615576a7753003286dd0c Mon Sep 17 00:00:00 2001
From: maxffarrell <72176209+maxffarrell@users.noreply.github.com>
Date: Mon, 16 Nov 2026 12:55:16 -0600
Subject: [PATCH 1/3] Explore native Svelte delivery without disturbing the
React registry.
Signed-off-by: Max Farrell <72176209+maxffarrell@users.noreply.github.com>
---
.github/workflows/checks.yml | 4 +-
package.json | 5 +-
registry/svelte/README.md | 83 ++++++++++++++++++++
registry/svelte/ask-card/ask-card.svelte | 44 +++++++++++
registry/svelte/dot-loader/dot-loader.svelte | 14 ++++
registry/svelte/examples/decision.svelte | 19 +++++
registry/svelte/registry.json | 50 ++++++++++++
scripts/build-svelte-registry.mjs | 45 +++++++++++
scripts/build-svelte-registry.test.mjs | 25 ++++++
9 files changed, 285 insertions(+), 4 deletions(-)
create mode 100644 registry/svelte/README.md
create mode 100644 registry/svelte/ask-card/ask-card.svelte
create mode 100644 registry/svelte/dot-loader/dot-loader.svelte
create mode 100644 registry/svelte/examples/decision.svelte
create mode 100644 registry/svelte/registry.json
create mode 100644 scripts/build-svelte-registry.mjs
create mode 100644 scripts/build-svelte-registry.test.mjs
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 39def38..2a72fe9 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -26,12 +26,12 @@ jobs:
node-version: 22
cache: npm
- run: npm ci
- - run: node --test scripts/block-metadata.test.mjs
+ - run: node --test scripts/block-metadata.test.mjs scripts/build-svelte-registry.test.mjs
# the documentation and the registry are generated: the types of what renders them depend on them
- run: npm run docs
- name: The registry is as committed
# registry.json is written by scripts/build-registry.mjs and is what shadcn add reads from
# GitHub; a component added without rebuilding it would be missing from the registry.
- run: git diff --exit-code registry.json
+ run: git diff --exit-code registry.json registry/svelte/registry.json
- run: npm run typecheck
- run: npm run build
diff --git a/package.json b/package.json
index 83fa8f7..a46e004 100644
--- a/package.json
+++ b/package.json
@@ -11,11 +11,12 @@
},
"type": "module",
"scripts": {
- "docs": "node scripts/build-docs.mjs && node scripts/build-registry.mjs",
+ "docs": "node scripts/build-docs.mjs && node scripts/build-registry.mjs && node scripts/build-svelte-registry.mjs",
"dev": "npm run docs && vite",
"build": "npm run docs && vite build",
"typecheck": "tsc -b",
- "preview": "vite preview"
+ "preview": "vite preview",
+ "test:svelte-registry": "node --test scripts/build-svelte-registry.test.mjs"
},
"dependencies": {
"@base-ui/react": "^1.8.0",
diff --git a/registry/svelte/README.md b/registry/svelte/README.md
new file mode 100644
index 0000000..0e27364
--- /dev/null
+++ b/registry/svelte/README.md
@@ -0,0 +1,83 @@
+# Svelte registry proof of concept
+
+Solid Glass is a React design system, not SolidJS. This additive registry explores
+Svelte 5 delivery through **shadcn-svelte**, while leaving every React component,
+registry name and URL intact. It is a starting point for maintainer discussion,
+not a complete framework port.
+
+## Install
+
+Start with a Tailwind CSS 4 / Svelte 5 project initialized with shadcn-svelte.
+After this branch is released to the site:
+
+```sh
+npx shadcn-svelte@latest add https://deeplethe.github.io/solid-glass/r/svelte/ask-card.json
+npx shadcn-svelte@latest add https://deeplethe.github.io/solid-glass/r/svelte/dot-loader.json
+```
+
+Each item installs the shared `src/solid-glass.css` too. Import it **after** the
+Tailwind and shadcn-svelte styles in the application's global stylesheet (adjust
+the relative path to that file):
+
+```css
+@import "./solid-glass.css";
+```
+
+Remove or move any competing `:root` / `.dark` color definitions before that
+import, so they do not override the material. Toggle `.dark` on `html` for dark
+mode. The theme falls back to system fonts if Geist is not installed. Do not
+copy the React-only `shadcn/tailwind.css` import from the shared CSS's comment.
+
+```svelte
+
+
+ { chosen = value } : undefined}
+/>
+```
+
+`class` replaces React's `className`. AskCard retains the existing `onAnswer`
+callback contract: omit it for an answered card, and pass `chosen` to identify
+the answer. The answer buttons remain focusable but inert. DotLoader retains
+`dotClassName`; supply an accessible status label in its surrounding context.
+`examples/decision.svelte` is a copyable interactive example.
+
+## Architecture and scope
+
+- `src/solid-glass.css` remains the sole material source. The Svelte builder
+ embeds it verbatim; no duplicated tokens or versioned npm package is needed.
+- `registry/svelte/` owns native `.svelte` source. Never install TSX via the
+ Svelte CLI. Future interactive ports should use Bits UI / shadcn-svelte
+ primitives, not a React runtime wrapper.
+- `public/r/svelte/` is an additive URL namespace, generated after the existing
+ React build (which clears `public/r`). `SOLID_GLASS_ORIGIN` configures dependency
+ URLs for a preview server. URLs are not published until the site is released.
+- This first slice covers **AskCard and DotLoader only**. It does not promise
+ parity for stock shadcn-svelte components: shared data-slot names are not
+ enough. The current stylesheet also relies on Base UI state attributes,
+ DOM structure and Tailwind class names; Bits UI checked/open/active states,
+ progress tracks, focus, disabled and portal behavior need dedicated audits.
+- No root workspace migration or published npm packages are necessary for a
+ source registry. Extract a shared package only when a second consumer needs
+ an independently versioned build or runtime API.
+
+## Development
+
+```sh
+npm run docs
+npm run test:svelte-registry
+npm run typecheck
+npm run build
+```
+
+These checks preserve the React build and test registry generation. They do not
+compile Svelte: before expanding this proof of concept, install the built URLs
+into a clean shadcn-svelte consumer, run its Svelte check/build, and examine both
+themes and keyboard interaction. Keep that consumer's dependencies separate
+from the React site. A production port also needs continuous browser coverage.
diff --git a/registry/svelte/ask-card/ask-card.svelte b/registry/svelte/ask-card/ask-card.svelte
new file mode 100644
index 0000000..d2bed00
--- /dev/null
+++ b/registry/svelte/ask-card/ask-card.svelte
@@ -0,0 +1,44 @@
+
+
+
+
{eyebrow}
+
{question}
+ {#if options.length > 0}
+
+ {#each options as option, index (index)}
+
+
+ {/each}
+
+ {/if}
+
diff --git a/registry/svelte/dot-loader/dot-loader.svelte b/registry/svelte/dot-loader/dot-loader.svelte
new file mode 100644
index 0000000..847f1f0
--- /dev/null
+++ b/registry/svelte/dot-loader/dot-loader.svelte
@@ -0,0 +1,14 @@
+
+
+
+ {#each [0, 1, 2] as index (index)}
+
+ {/each}
+
diff --git a/registry/svelte/examples/decision.svelte b/registry/svelte/examples/decision.svelte
new file mode 100644
index 0000000..67e1d71
--- /dev/null
+++ b/registry/svelte/examples/decision.svelte
@@ -0,0 +1,19 @@
+
+
+
+