Skip to main content
Architecture·pnpm workspaces

The monorepo that ships everything.

Two packages, two apps, one cascade. Tokens flow into UI, UI flows into Storybook and the public showcase — all wired at install time, no copy-paste between repos.

Packages
2+ 2 apps, 2 configs
Token tiers
3primitive → comp.
Components
43in @wyliedog/ui
Dependency graph
App10.6.6

apps/storybook

component docs

AppNext.js 16

apps/showcase

this site

Package · componentsv0.0.0

packages/ui

43 React components on Radix

Package · tokensv0.0.1

packages/tokens

1520 OKLCH design tokens

Figma plugin

Token Bridge

workspace depsync onlyworkspace dependencies
4 nodes · 3 edges
Workspaces

Two packages, two apps.

Each workspace has one job. Tokens publish raw values; UI publishes typed components; Storybook documents them; Showcase puts them in front of the world. No package reaches across — all dependencies flow upward through @wyliedog/*.

@wyliedog/tokens

packages/tokens

v0.0.1

The single source of truth. Source JSON files plus a Style Dictionary config that emits tokens.css with primitive, semantic, and component tiers as CSS custom properties.

Stack
Style Dictionary · TypeScript
Outputs
tokens.css · index.js · manifest.json
Depended on by
@wyliedog/ui
1520 tokens · 3 tiers

@wyliedog/ui

packages/ui

v0.0.0

43 typed React components with CVA variants: 24 are built on Radix primitives and the rest are plain forwardRef components. Compiles Tailwind and tokens.css into @wyliedog/ui/styles.

Stack
React 19.3 · TypeScript 6.0 · tsup
Foundation
Radix UI · CVA · Slot
Depended on by
storybook · showcase
tree-shakeable · subpath exports

@wyliedog/storybook

apps/storybook

v10.6.6

Component documentation and the pattern playground. Every component in @wyliedog/ui has a story file. Stories run as accessibility tests in the test suite, and a curated set has visual regression baselines.

Stack
Storybook 10.6.6 · Vite 8.3
Consumes
@wyliedog/ui
Deploy
wyliedogstorybook.com · Netlify
Accessibility checks enforced in tests

@wyliedog/showcase

apps/showcase

Next 16

The page you're reading. A Next.js App Router site that consumes @wyliedog/ui as its only component dependency — the marketing site eats its own design system.

Stack
Next.js 16.4 · App Router
Consumes
@wyliedog/ui
Deploy
wyliedog.com
Counts and token values are read from the repo
Token pipeline

From JSON to CSS variables, in three tiers.

Source files describe the design intent in human terms. Style Dictionary expands them into raw values, role aliases, and component-specific surfaces — all emitted as a single tokens.css that Tailwind 4 reads at build time.

01 · source
packages/tokens/io/sync/

primitive.json (excerpt)

{
"primitive": {
"variables": {
"color.fiery-coral.700": {
"$type": "color",
"$value": "oklch(0.508 0.139 37.8)"
}
}
}
}
286 primitive entries
02 · transform
style-dictionary.config.js

build pipeline

  • 1parse JSON refs
  • 2resolve alias chains
  • 3tokens-studio transforms
  • 4custom CSS formats
  • style-dictionary build
1520 vars emitted
03 · output
packages/tokens/dist/

tokens.css

/* primitive */
--color-fiery-coral-700: oklch(0.508 0.139 37.8);
/* semantic */
--color-background-primary: oklch(0.508 0.139 37.8);
/* component */
--color-button-primary-background: oklch(0.508 0.139 37.8);
286 primitive · 102 semantic · 1132 component
04 · consume
JSX · Tailwind 4

Button.tsx

<button
className="
bg-(--color-button-primary-background)
text-(--color-foreground-inverse)
px-4 h-10
">
Save changes
</button>

render

Tier 1 · primitive

Raw OKLCH ramps. --color-fiery-coral-700 doesn't know what it'll be used for — it just is.

Tier 2 · semantic

Role aliases. --color-background-primary maps to fiery-coral-700 in light and dark, and re-resolves under any future theme.

Tier 3 · component

Surface-specific. --color-button-primary-background points at the semantic role — never at the primitive directly.

Build flow

One command, four artifacts.

Turbo orchestrates the graph. Tokens build first, UI rebuilds against the new CSS, and Storybook + Showcase pick up the changes through their workspace symlinks. No package republishes — everything resolves through pnpm.

~/wyliedog · mainzsh
$ pnpm build
turbo run build
▸ @wyliedog/tokens#build style-dictionary
→ dist/tokens.css 1520 vars
→ dist/index.js
→ dist/manifest.json
✓ done
▸ @wyliedog/ui#build tailwind + tsup
→ dist/index.css
✓ done · one entry per component (.js · .cjs · .d.ts)
▸ @wyliedog/storybook#build
✓ build:css, then storybook build
▸ @wyliedog/showcase#build
✓ next build
$

Build dependency graph

  1. 1

    Tokens build

    style-dictionary

    Reads JSON source files, resolves aliases, emits tokens.css with all 1520 custom properties plus JS exports, types and a manifest.

  2. 2

    UI build

    tailwind + tsup

    Picks up the fresh tokens.css via workspace symlink. tsup builds each of the 43 components as its own ESM and CommonJS entry, so imports are tree-shakeable.

  3. 3

    Storybook

    build:css + storybook build

    Compiles its own Tailwind sheet and builds the docs, so the stories render against the new token values.

  4. 4

    Showcase

    next build

    Reads token values and counts from the repo, so the public site reflects the new tokens on its next build.

Component layer

Every component, the same five layers.

No bespoke component shapes. Components in @wyliedog/ui are forwardRef wrappers, 24 of them around a Radix primitive, with CVA driving variants, Tailwind classes backed by tokens, and an asChild escape hatch through Slot where it applies. The excerpt below is simplified.

Button.tsx
import { forwardRef } from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "./lib/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center rounded-md font-medium",
{
variants: {
variant: {
default: "bg-(--color-background-primary) text-(--color-foreground-inverse)",
outline: "border border-(--color-border-default) bg-transparent",
},
}
}
)
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return <Comp ref={ref} className={cn(buttonVariants({ variant, size }), className)} { ...props } />
}
)
①

forwardRef-first wrapper types

Every component accepts a ref, enabling integration with form libraries and animation tools without wrapper divs.

②

CVA variants, compact type strings

Class variance authority keeps variant logic co-located with the component, generating precise TypeScript types automatically.

③

className merges, static class strings

cn() merges caller className last so any consumer can override without !important or specificity battles.

④

Base classes: component + token

Base styles use component token variables — bg-(--color-button-primary-background) — which alias semantic tones, so every component automatically respects the active theme.

⑤

asChild via @radix-ui/react-slot

Pass asChild to render any element or component as the root, preserving all Radix accessibility behavior without an extra DOM node.

Everything wires together at install time.

Two packages. One install. Everything flows through the Figma-to-git path, and ends up in the same place.