Meridian
esc
  • Actions

  • Navigate

navigate selectesc close

Meridian/Kit · Quality & package

Kit · Quality & package

Tested, then shipped as one package.

The kit is @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.
Install in an app
$ 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
vite.config.ts
import stylex from "@stylexjs/unplugin";
export default defineConfig({ plugins: [stylex.vite(), react()] });
// The plugin finds @meridian/ui (it depends on StyleX) and compiles it.
Entry points
"@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

The kit's npm scripts
ScriptWhat it does
npm testVitest + Testing Library + axe: keyboard, focus, ARIA, no violations
npm run test:visualPlaywright screenshots of every gallery view, light/dark, desktop/phone
npm run storiesLadle stories for every component, with a theme toggle
npm run galleryThe live gallery app (Vite + StyleX dev CSS)
npm run lintESLint with @meridian/eslint-plugin: the book's rules as errors
npm run typecheckStrict TypeScript across kit, tests and stories
npm run buildEmit 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 paths of @meridian/ui and what each exports
ImportWhatResolves to
@meridian/uiAll components./dist/components/index.js
@meridian/ui/tokenstheme, type, global (styles and themes, not variables)./dist/tokens/index.js
@meridian/ui/tokens.stylexVariables: colors, kinds, shadows, fonts, space, radius, motion, layout./dist/tokens/tokens.stylex.js
@meridian/ui/palette.stylexConstants: media (breakpoints and queries), light, dark, ramp./dist/tokens/palette.stylex.js
@meridian/ui/marketingLanding-page blocks./dist/marketing/index.js
@meridian/ui/authSign-in, sign-up, 2FA, invites, first run./dist/auth/index.js
@meridian/ui/saasSettings 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.md
  • sideEffects: false, so unused components tree-shake away.
  • prepublishOnly runs 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

Vitest files, their suites and test counts
FileSuitesTestsaxe
tests/blocks.test.tsxOtpInput, SignInForm, Marketing blocks51
tests/core.test.tsxButton, Field + Input, Choice controls, Status and Badge, Menu, Tabs (in-page), TagInput, ConfirmDialog, CopyButton141
tests/data.test.tsxniceTicks, Charts, DataTable61
tests/fleet.test.tsxHeatmap, StatusGrid, Fleet a11y102
tests/infra.test.tsxlayered layout, TopologyGraph, RackElevation, SwitchFaceplate143
tests/misc.test.tsxTime, TreeView51
tests/network.test.tsxIPv4, IPv6, CIDR, MAC, ASN, VLAN lists, Ports, IpInput, CidrInput, Other inputs, SubnetCalculator, Network a11y751
tests/ops.test.tsxdiffLines, foldUnchanged / toSplitRows / inlineChange, parseAnsi, log filtering and search, iosConfig stream mode, textToKeysyms, DiffViewer, RemoteConsole (demo mode, no network), LogStream, CodeEditor325
tests/saas.test.tsxApiKeysPanel, RolesMatrix, NotificationCenter, WebhooksPanel, AuditLog, SettingsSection, MembersPanel, accessibility (axe)2914
Total19029

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

Playwright baselines per project
Snapshotdesktopphone
auth-dark.pngBaselineBaseline
auth-light.pngBaselineBaseline
components-dark.pngBaselineBaseline
components-light.pngBaselineBaseline
confirm.pngBaselineBaseline
dashboards-dark.pngBaselineBaseline
dashboards-light.pngBaselineBaseline
infra-dark.pngBaselineBaseline
infra-light.pngBaselineBaseline
marketing-dark.pngBaselineBaseline
marketing-light.pngBaselineBaseline
ops-dark.pngBaselineBaseline
ops-light.pngBaselineBaseline
overlays.pngBaselineSkipped
palette.pngBaselineBaseline
settings-dark.pngBaselineBaseline
settings-light.pngBaselineBaseline
tools-dark.pngBaselineBaseline
tools-light.pngBaselineBaseline

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.

playwright.config.ts
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/config.mjs
/** 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