diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 39def38..9a05746 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -18,20 +18,53 @@ concurrency:
jobs:
# Branch protection asks for this job by name: renaming it takes it out of the merge gate.
web:
+ # Keep the existing protected check authoritative for both frameworks.
+ needs: svelte
+ if: ${{ always() }}
runs-on: ubuntu-latest
steps:
+ - name: Svelte consumer passed
+ env:
+ SVELTE_RESULT: ${{ needs.svelte.result }}
+ run: test "$SVELTE_RESULT" = success
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
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
+
+ svelte:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+ cache-dependency-path: tests/svelte/package-lock.json
+ - run: node scripts/build-svelte-registry.mjs
+ - run: npm ci
+ working-directory: tests/svelte
+ - run: npm run install:registry
+ working-directory: tests/svelte
+ - run: npm run check && npm run build
+ working-directory: tests/svelte
+ - run: npx playwright install --with-deps chromium
+ working-directory: tests/svelte
+ - run: npm test
+ working-directory: tests/svelte
+ - uses: actions/upload-artifact@v4
+ if: always()
+ with:
+ name: svelte-browser-results
+ path: tests/svelte/test-results/
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..3615856
--- /dev/null
+++ b/registry/svelte/README.md
@@ -0,0 +1,129 @@
+# Svelte registry
+
+Solid Glass is a React design system, not SolidJS. This additive registry delivers
+native Svelte 5 **AskCard and DotLoader** through **shadcn-svelte**, while leaving
+every React component, registry name and URL intact. Other components and blocks
+are not part of this Svelte release.
+
+## 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 "tailwindcss";
+@import "tw-animate-css";
+@import "./solid-glass.css";
+```
+
+Keep all imports before ordinary CSS rules. Remove the competing `:root` /
+`.dark` color definitions generated by shadcn-svelte, so they do not override
+the material. Keep any intentional application overrides after the imports.
+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. The `$UTILS$` import marker is intentionally resolved by that CLI
+ from the consuming project's configured utils alias; these are registry
+ templates, not files to copy directly. 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 registry 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 commands preserve the React build and test registry generation. The
+isolated consumer in `tests/svelte` also installs the built registry through the
+real shadcn-svelte CLI, typechecks and builds the installed Svelte source, and
+runs browser checks. Its dependencies are separate from the React site.
+
+### Compatibility boundary
+
+AskCard uses native buttons, not Base UI or Bits UI. Its `data-slot="ask-card"`,
+`glass-panel`, `glass-chosen`, focus outline, answered/selected classes and DOM
+structure match the React component. DotLoader uses the same three spans,
+160 ms stagger and canonical reduced-motion rule. Neither port needs framework
+state-attribute translation. Keep the controlled `chosen`/`onAnswer` contract:
+`chosen` alone highlights a choice; removing `onAnswer` makes the card inert.
+
+Do not treat the shared stylesheet as a supported drop-in theme for arbitrary
+shadcn-svelte widgets. Base UI and Bits UI differ in state attributes, portal
+markup and track structure. Future checkbox, tabs, menu, dialog and progress
+ports must each add a native consumer fixture and state/keyboard/theme tests
+before their registry entries are published.
+
+Run the consumer with Node 22 (the CI version) after `npm run docs`:
+
+```sh
+cd tests/svelte
+npm ci
+npm run install:registry
+npm run check
+npm run build
+npx playwright install chromium
+npm test
+```
+
+The fixture deliberately uses nondefault UI and utils aliases. Browser tests run
+against its production build, covering both themes, keyboard choice/focus,
+answered-state inertness, reset, small-screen wrapping and reduced motion.
+
+If installed component files are excluded by `.gitignore`, Tailwind 4 will not
+scan them automatically. Register their actual directory with `@source` in your
+app stylesheet (after the imports), for example:
+
+```css
+@source "./lib/components/ui/**/*.svelte";
+```
+
+The fixture explicitly registers its gitignored custom UI directory and asserts
+rendered padding, rounding, gaps and dot sizes to catch missing utility output.
diff --git a/registry/svelte/ask-card/ask-card.svelte b/registry/svelte/ask-card/ask-card.svelte
new file mode 100644
index 0000000..a4d74e5
--- /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..35bb7ad
--- /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 @@
+
+
+
+