@city-of-baltimore/bromo

中文文档
1.4.4发布于 2026/11/09MITTypeScriptES Module零依赖近 30 天下载 3041

Baltimore Design System — React + MUI components, tokens, and app shell for City of Baltimore civic applications

原始使用文档
文档目录6 节
  1. Install
  2. Quick start
  3. Entry points
  4. Versioning
  5. Accessibility
  6. License

Baltimore Design System

React components, design tokens, and an app shell for City of Baltimore civic applications — one visual and interaction language across the city's digital services, built on MUI and React 19. Exact supported peer ranges live in this package's peerDependencies.

Component catalog / Storybook: https://bromo-design-system.fly.dev

Install

npm install @city-of-baltimore/bromo

No registry configuration or tokens required.

Quick start

Wrap your app once, import the stylesheet once, and use the shell:

// main.tsx
import "@city-of-baltimore/bromo/styles.css"; // network-free resets and tokens
import { BromoProvider } from "@city-of-baltimore/bromo";

createRoot(document.getElementById("root")!).render(
  <BromoProvider config={{ productTitle: "311 Explorer" }}>
    <App />
  </BromoProvider>,
);
import { PageShell, Surface, Button } from "@city-of-baltimore/bromo";

export function HomePage() {
  return (
    <PageShell eyebrow="Operations" title="Service requests" subtitle="Citywide view">
      <Surface>
        <Button>Export</Button>
      </Surface>
    </PageShell>
  );
}

BromoProvider wires the theme, CssBaseline, light/dark color mode, and the --bromo-* design tokens — don't add your own ThemeProvider around it. No router is required: shell links render plain anchors by default. A router integration can supply the public linkComponent seam with an implementation that accepts href; this does not transfer navigation policy to the kit.

Bromo's typography stacks prefer the approved City families and include complete system fallbacks. The package itself declares no @font-face, ships no font binary, and contacts no font host — so a licence question can never contaminate this tarball.

Font delivery lives in the separately governed adapter, @city-of-baltimore/bromo-fonts, which is published from the same release event and carries the same version as this package. Install it only if you want the branded faces; omit it and the browser uses the system fallback stack without a font request. See the typography contract.

For instance-local appearance configuration, share one BromoColorModeOptions object between initializeBromoColorMode (called before createRoot) and the provider's colorMode prop. The initializer stamps the resolved appearance preference before rendering; the stylesheet cascade supplies the token values and returns the resolved mode plus reduced-motion state for app-owned document tokens. themeOverrides may remain a static MUI options object or become a factory receiving that mode/reduced-motion context. Primary- and error-palette overrides provide a readable main / contrastText pair. Bromo derives visibly distinct hover and pressed fills while leaving MUI's general dark shade independent, and rejects an unsafe enabled Button state rather than letting it ship. See docs/use/toolkit_consumer_setup.md in the repository for the full example.

Entry points

Heavy optional dependencies never ride along with a button: chart and map components live on their own subpaths, each behind optional peer dependencies.

ImportContentsOptional peer
@city-of-baltimore/bromocomponents, providers, theme/color-mode helpers, systems token layer—
…/tokenstheme, color-mode, and typography contracts—
…/chartsChart (+ DataTable re-export)@mui/x-charts
…/mapGeoMap, MapFrame, MapLegend, MapA11ySummarymaplibre-gl
…/styles.cssnetwork-free resets and CSS tokens—

Required peers include React, MUI, and Emotion (React Router is an optional integration via linkComponent). Install the exact ranges declared by the released package's peerDependencies. API transport, auth, and runtime helpers belong to @city-of-baltimore/patapsco; Bromo has no ./api export.

Versioning

Semantic versioning over a frozen public API: every export of the root entry, the subpath layout, and the --bromo-* CSS custom property names. Deprecations ship at least one minor release before removal, with migration notes in the CHANGELOG.

Accessibility

Components target WCAG 2.2 AA: two-tone focus indicators, reviewed status inks in both color modes, and selection states that do not rely on color alone. Storybook's accessibility addon supports explicit interactive review in manual mode. Playwright alone owns automated axe execution in the release gate, where it scans every indexed story in both light and dark mode, runs keyboard interaction checks, and verifies representative visual snapshots. Manual and consumer-flow testing remain required for conformance.

License

MIT — the same license as the GOV.UK Design System. This design system is public infrastructure: any government, civic organization, or vendor is welcome to use, adapt, and build on it — that's the point. The "City of Baltimore" name, seal, and brand assets identify official city services and remain protected by trademark law; don't use them to imply endorsement.


Built by the City of Baltimore.

版本与发布记录

@city-of-baltimore/bromo 共发布 124 个版本,首次发布于 2026/07/13;过去 12 个月发布了 124 个版本。

版本发布日期距今
1.4.4latest2026/11/09今天
2.0.0-beta.3next2026/11/091 天前
2.0.0-beta.22026/11/081 天前
2.0.0-beta.12026/11/082 天前
1.4.32026/11/054 天前
1.4.22026/10/2317 天前

关于 @city-of-baltimore/bromo 的常见问题

@city-of-baltimore/bromo 是什么?

Baltimore Design System — React + MUI components, tokens, and app shell for City of Baltimore civic applications

如何安装 @city-of-baltimore/bromo?

在项目目录运行 npm install @city-of-baltimore/bromo,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.2.0)、react-dom(^19.2.0)、@mui/utils(^9.3.0)、@mui/system(^9.3.0)、@mui/material(^9.3.1)、@emotion/cache(^11.14.0)、@emotion/react(^11.14.0)、@emotion/styled(^11.14.1)、@mui/icons-material(^9.3.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 bromo-check、bromo-tokens、bromo-codemod,可以用 npx bromo-check 直接运行。

@city-of-baltimore/bromo 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@city-of-baltimore/bromo 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@city-of-baltimore/bromo 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=26 <27。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@city-of-baltimore/bromo 可以商用吗?

@city-of-baltimore/bromo 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@city-of-baltimore/bromo 的下载量有多少?

根据 npm 官方下载统计,@city-of-baltimore/bromo 在 2026/10/10 – 2026/11/08 这 30 天内被下载 3,041 次,日均约 101 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@city-of-baltimore/bromo 还在维护吗?

最新版本 1.4.4 发布于 2026/11/09(今天);至今共发布 124 个版本,其中过去 12 个月发布了 124 个;首次发布于 2026/07/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。