Meridian/Kit · Quality & package
Kit · Quality & package
Tested, then shipped
as one package.
@meridian/ui, published uncompiled so each app's StyleX compiler processes it. Every change runs types, unit and accessibility tests, and visual regression in light, dark and at phone width.$ npm i https://design.chopper.dev/packages/meridian-ui-0.1.0.tgz
$ npm i @stylexjs/stylex @fontsource-variable/inter @fontsource-variable/geist-mono
$ npm i -D @stylexjs/unplugin
import stylex from "@stylexjs/unplugin";
export default defineConfig({ plugins: [stylex.vite(), react()] });
// The plugin finds @meridian/ui (it depends on StyleX) and compiles it."@meridian/ui" // components
"@meridian/ui/tokens" // theme, type, global
"@meridian/ui/tokens.stylex" // colors, space, radius… (vars)
"@meridian/ui/palette.stylex" // media, light, dark
"@meridian/ui/marketing" · "/auth" · "/saas" · "/emails/*"Scripts
| Script | What it does |
|---|---|
| npm test | Vitest + Testing Library + axe: keyboard, focus, ARIA, no violations |
| npm run test:visual | Playwright screenshots of every gallery view, light/dark, desktop/phone |
| npm run stories | Ladle stories for every component, with a theme toggle |
| npm run gallery | The live gallery app (Vite + StyleX dev CSS) |
| npm run lint | ESLint with @meridian/eslint-plugin: the book's rules as errors |
| npm run typecheck | Strict TypeScript across kit, tests and stories |
| npm run build | Emit dist/ with types; StyleX stays uncompiled |
Verified: the packed tarball installs into a fresh Vite app, builds, and renders with app-side StyleX reading the package's tokens.
Unit & a11y tests
190
in 9 Vitest files; 29 axe checks
Lint rule tests
141
node:test and RuleTester cases for @meridian/eslint-plugin
Visual baselines
37
19 desktop + 18 phone, light and dark
Ladle stories
75
in 14 story files, every one light and dark
Entry points
| Import | What | Resolves to |
|---|---|---|
| @meridian/ui | All components | ./dist/components/index.js |
| @meridian/ui/tokens | theme, type, global (styles and themes, not variables) | ./dist/tokens/index.js |
| @meridian/ui/tokens.stylex | Variables: colors, kinds, shadows, fonts, space, radius, motion, layout | ./dist/tokens/tokens.stylex.js |
| @meridian/ui/palette.stylex | Constants: media (breakpoints and queries), light, dark, ramp | ./dist/tokens/palette.stylex.js |
| @meridian/ui/marketing | Landing-page blocks | ./dist/marketing/index.js |
| @meridian/ui/auth | Sign-in, sign-up, 2FA, invites, first run | ./dist/auth/index.js |
| @meridian/ui/saas | Settings and account blocks: API keys, webhooks, roles, audit log, notifications, billing, usage, members | ./dist/saas/index.js |
| @meridian/ui/emails/<Template> | react-email templates (optional peer: @react-email/components) | ./dist/emails/*.js |
Published
files:dist,README.mdsideEffects: false, so unused components tree-shake away.prepublishOnlyruns typecheck, lint, tests, then build.
Peers
- @stylexjs/stylex ^0.19.1
- react >=19
- react-dom >=19
Dependencies: @floating-ui/react-dom, lucide-react.
Optional peers · 13
- Terminal: 2 packages (xterm, addon-fit)
- Email templates: 1 package (components)
- CodeEditor: 9 packages (state, view, commands, language, search, lang-json, lang-yaml, legacy-modes, highlight)
- RemoteConsole: 1 package (novnc)
Each loads with a dynamic import when its component mounts; all are safe with server rendering.
Unit, interaction and accessibility tests · 190
| File | Suites | Tests | axe |
|---|---|---|---|
| tests/blocks.test.tsx | OtpInput, SignInForm, Marketing blocks | 5 | 1 |
| tests/core.test.tsx | Button, Field + Input, Choice controls, Status and Badge, Menu, Tabs (in-page), TagInput, ConfirmDialog, CopyButton | 14 | 1 |
| tests/data.test.tsx | niceTicks, Charts, DataTable | 6 | 1 |
| tests/fleet.test.tsx | Heatmap, StatusGrid, Fleet a11y | 10 | 2 |
| tests/infra.test.tsx | layered layout, TopologyGraph, RackElevation, SwitchFaceplate | 14 | 3 |
| tests/misc.test.tsx | Time, TreeView | 5 | 1 |
| tests/network.test.tsx | IPv4, IPv6, CIDR, MAC, ASN, VLAN lists, Ports, IpInput, CidrInput, Other inputs, SubnetCalculator, Network a11y | 75 | 1 |
| tests/ops.test.tsx | diffLines, foldUnchanged / toSplitRows / inlineChange, parseAnsi, log filtering and search, iosConfig stream mode, textToKeysyms, DiffViewer, RemoteConsole (demo mode, no network), LogStream, CodeEditor | 32 | 5 |
| tests/saas.test.tsx | ApiKeysPanel, RolesMatrix, NotificationCenter, WebhooksPanel, AuditLog, SettingsSection, MembersPanel, accessibility (axe) | 29 | 14 |
| Total | 190 | 29 | |
Vitest runs in jsdom with Testing Library and user-event: real keyboard and pointer events, focus order, roles and ARIA states. it.each tables count once per row, as Vitest reports them.
The a11y() helper runs axe-core on the rendered container and expects no violations. Colour contrast is off there, because jsdom has no layout or colour; contrast is covered by the visual suite and the token tests.
Visual regression · 37 baselines
| Snapshot | desktop | phone |
|---|---|---|
| auth-dark.png | Baseline | Baseline |
| auth-light.png | Baseline | Baseline |
| components-dark.png | Baseline | Baseline |
| components-light.png | Baseline | Baseline |
| confirm.png | Baseline | Baseline |
| dashboards-dark.png | Baseline | Baseline |
| dashboards-light.png | Baseline | Baseline |
| infra-dark.png | Baseline | Baseline |
| infra-light.png | Baseline | Baseline |
| marketing-dark.png | Baseline | Baseline |
| marketing-light.png | Baseline | Baseline |
| ops-dark.png | Baseline | Baseline |
| ops-light.png | Baseline | Baseline |
| overlays.png | Baseline | Skipped |
| palette.png | Baseline | Baseline |
| settings-dark.png | Baseline | Baseline |
| settings-light.png | Baseline | Baseline |
| tools-dark.png | Baseline | Baseline |
| tools-light.png | Baseline | Baseline |
Playwright builds the gallery and screenshots every view (components, dashboards, tools, infra, ops, settings, marketing, auth) full-page in light and dark, plus the command palette, the confirm dialog and the menu, tooltip and toast. The overlays shot is desktop only because it is hover-driven.
Runs are deterministic: the clock is frozen, animations and the caret are off, and the terminal canvas is masked. A diff over 0.2% of pixels fails. Accept intentional changes with npm run test:visual:update.
import { defineConfig, devices } from "@playwright/test";
/** Visual regression against the built gallery (npm run test:visual). */
export default defineConfig({
testDir: "visual",
snapshotPathTemplate: "visual/__screenshots__/{projectName}/{arg}{ext}",
expect: { toHaveScreenshot: { maxDiffPixelRatio: 0.002, animations: "disabled", caret: "hide" } },
webServer: { command: "npx vite preview --port 4317 --strictPort", port: 4317, reuseExistingServer: true },
use: {
baseURL: "http://localhost:4317",
launchOptions: process.env.CHROMIUM_PATH ? { executablePath: process.env.CHROMIUM_PATH } : {},
},
projects: [
{ name: "desktop", use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 900 } } },
{ name: "phone", use: { ...devices["Desktop Chrome"], viewport: { width: 390, height: 844 }, deviceScaleFactor: 2 } },
],
});
Ladle stories · 75
Actions5
Variants · Sizes · With Icon And Shortcut · Icon Buttons · Groups
Code & plans2
Code · Plan
Charts & tables2
Charts · Data Table With Filters
Data display4
Cards · Tables · Details · Logs
Forms7
Text Fields · Selects · Numbers · Secrets · Tags · Choices · Dates And Files
Infrastructure9
Site Overview · Topology · Topology Straight · Manual Layout · Rack · Small Rack · Faceplate48 · Faceplate24 Sfp · Faceplate8
Navigation4
Header · Tabs And Segments · Settings · Wizard
Network & fleet8
Add Site Subnet · Fleet Overview · Inputs · Errors · Planner · Planner IPv6 · Heatmap Small · Status Grid Sizes
Ops: consoles, editor & logs5
All Ops · Console States · Yaml Editor · Unified Diff · Fifty Thousand Lines
Overlays3
Dialogs · Menus And Popovers · Command Menu
Pages2
Marketing · Auth
Settings & account13
Api Keys · Webhooks · Roles · Members · Audit Log · Notifications · Billing · Usage · General · All Panels · Members Sso Managed · Notification Inbox · Section
Status & feedback7
Status Hexagons · Badges · Meters · Banners · Empty · Loading · Toasts
Time, terminal & trees4
Time And Dates · Terminal · Trees · More Overlays And Layout
npm run stories opens Ladle on the same Vite config as the gallery. A global provider applies Meridian's forced theme from Ladle's light/dark toggle, and the width addon checks phone layouts.
/** Ladle (npm run stories): every component in light and dark, with a theme toggle in the toolbar. */
export default {
stories: "stories/**/*.stories.tsx",
addons: { theme: { enabled: true, defaultState: "light" }, width: { enabled: true }, rtl: { enabled: false } },
outDir: "dist-stories",
};
Meridian Design Language49