@usesource/adapter-mui
v0.1.0
Published
MUI (Material-UI) ↔ canonical SOURCE mapping pack. Maps MUI component names and palette/theme tokens to source.* canonical IDs so cross-library translate tools (in @usesource/mcp / @usesource/scan) can pivot through SOURCE.
Maintainers
Readme
@usesource/adapter-mui
MUI (Material-UI) ↔ canonical SOURCE mapping pack. Maps MUI component
names and palette/theme tokens to source.* canonical IDs so
cross-library translate tools (in @usesource/mcp and @usesource/scan) can
pivot through SOURCE without library-specific mapping code.
Install
npm install @usesource/adapter-muiUse
import {
lookupByIdentifier,
lookupByCanonical,
listMappings,
ADAPTER_INFO,
} from "@usesource/adapter-mui";
// MUI → canonical
const buttonMapping = lookupByIdentifier("Button", "component");
// → { canonical: "source.element.button", confidence: 1, ... }
const palettePrimary = lookupByIdentifier("palette.primary.main", "token");
// → { canonical: "source.core.color.primary.500", confidence: 0.9, ... }
// canonical → MUI (reverse)
const matches = lookupByCanonical("source.element.button");
// → [{ identifier: "Button", confidence: 1, ... }]
console.log(ADAPTER_INFO);
// → { library: "mui", version: "0.1.0", mappingCount: 40 }What's mapped (v0.1.0)
| Type | Count | Examples |
|---|---:|---|
| component | 29 | Button, Card, Dialog, TextField, Drawer, Snackbar, … |
| token | 11 | palette.primary.main, palette.text.secondary, palette.error.main, palette.divider, shape.borderRadius, … |
Notable renames captured in mapping notes:
- MUI
Drawer↔ canonicaldrawer(shadcn calls itSheet) - MUI
Snackbar↔ canonicaltoast - MUI
Divider↔ canonicalseparator - MUI
LinearProgress+CircularProgressboth ↔ canonicalprogress - MUI
errorpalette ↔ canonicaldestructive
Cross-library translation
Combined with @usesource/adapter-shadcn, the canonical pivot enables
direct lib-to-lib translation through @usesource/mcp:
{
"name": "source_translate",
"arguments": {
"fromLibrary": "shadcn",
"identifier": "Button",
"identifierType": "component",
"toLibrary": "mui"
}
}
// → { canonical: "source.element.button", target: { library: "mui", identifier: "Button", confidence: 1.0 } }The translator does not need to know about MUI or shadcn specifically — it just pivots through the canonical ID.
License
Apache-2.0. See LICENSE at the repository root.
