Skip to content

feat: add tile matcher + games layer#5

Merged
ShaunSHamilton merged 3 commits into
mainfrom
feat_tile-matcher
Jul 13, 2026
Merged

feat: add tile matcher + games layer#5
ShaunSHamilton merged 3 commits into
mainfrom
feat_tile-matcher

Conversation

@ShaunSHamilton

Copy link
Copy Markdown
Contributor

Summary

What changes? Why?

Details

Component - TileMatcher

  • pairs model: one face → duplicated (classic concentration), two faces → related match (term↔definition). Deck size = 2 × pairs.length.
  • Faces accept any node (text, , , icon) or { content, label } for accessible names on image tiles.
  • animateFlip (3D flip vs instant), faceDown, columns, mismatchDelay, disabled, shuffle/seed (seeded mulberry32 PRNG for determinism).
  • Callbacks: onMatch, onMismatch, onComplete({ moves, matches }).
  • A11y: native tiles, per-tile aria-label, aria-live status region, matched tiles disabled, reduced-motion aware.

Styling - .tile-matcher* BEM appended to components.css using existing tokens; 3D rotateY flip mirroring the Modal transform pattern; handles flip / no-flip / faces-open modes.

Layer wiring - new src/games/ barrel, added to index.ts, tsup.config.ts, ./games export in package.json, and LAYER_SUBPATHS in package.test.ts. Build emits dist/games.{js,cjs,d.ts,d.cts}.

Docs - category:'game' enum, tile-matcher.mdx, showcase + demo island.

Changeset - .changeset/tile-matcher-game.md on uikit + uikit-css.

Type of change

  • feat — new behavior
  • fix — bug fix
  • refactor — no behavior change
  • docs — documentation only
  • chore / ci / build — tooling, infra
  • test — tests only

Pre-flight checklist

  • pnpm changeset added (skip for chore / docs / test / ci-only PRs)
  • pnpm test, pnpm typecheck, pnpm lint, pnpm format:check clean locally
  • Visual goldens refreshed if UI changed (pnpm test:visual:update on macOS;
    Linux goldens regenerated via the Playwright Docker image — see
    docs/runbooks/deploy-docs.md)
  • apps/docs/public/{_headers,_redirects,robots.txt} unchanged or
    rebaselined deliberately
  • ADR added or updated if a locked decision changes (see
    docs/adr/README.md)

Screenshots / GIF

image

@ShaunSHamilton

Copy link
Copy Markdown
Contributor Author

@moT01 Seeing as we are moving fast and breaking things, I added this. If you do not have a completely different idea, then feel free to merge.

@ShaunSHamilton
ShaunSHamilton merged commit ad5da3f into main Jul 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant