Extract independent MIT Mortar kit and contribution workflow
Mortar contribution checks / Mortar baseline and browser checks (push) Successful in 3m15s

This commit is contained in:
tony committed 2026-10-13 22:16:21 +01:00
commit 43fe76158c
108 files changed
+10081

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Mortar component playground</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/main.tsx"></script>
</body>
</html>
+55
View File
@@ -0,0 +1,55 @@
import { Suspense, lazy, type ComponentType } from "react";
import { createRoot } from "react-dom/client";
import {
ThemeProvider,
Select,
AppearanceControl,
PageHeading,
Notice,
} from "../src/index.js";
import catalog from "../catalog.json";
import "./styles.css";
const fixtures = import.meta.glob("../previews/*Preview.tsx");
const params = new URLSearchParams(location.search);
const component = params.get("component") || "Button";
const loader = fixtures[`../previews/${component}Preview.tsx`];
const Preview = loader
? lazy(loader as () => Promise<{ default: ComponentType }>)
: null;
createRoot(document.getElementById("root")!).render(
<ThemeProvider
brand={params.get("brand") === "green" ? "green" : "neutral"}
initialAppearance={params.get("theme") === "dark" ? "dark" : "light"}
>
<main className="m-stack p-6 mx-auto max-w-6xl">
<PageHeading
title="Mortar playground"
description="Shared components and shells. No service account required."
/>
<div className="flex flex-wrap gap-4 items-end">
<Select
label="Component"
value={component}
options={catalog.components.map((c) => ({
value: c.export,
label: c.name,
}))}
onChange={(e) => {
params.set("component", e.target.value);
location.search = params.toString();
}}
/>
<AppearanceControl />
</div>
<Suspense fallback={<p role="status">Loading preview…</p>}>
{Preview ? (
<Preview />
) : (
<Notice title="Unknown component" tone="danger">
Choose a component from the catalogue.
</Notice>
)}
</Suspense>
</main>
</ThemeProvider>,
);
+4
View File
@@ -0,0 +1,4 @@
@import "tailwindcss";
@import "../styles.css";
@source '../src';
@source '../previews';