@bloom-housing/ui-components

中文文档
14.1.1发布于 2026/09/18Apache-2.0CommonJS近 30 天下载 2930

Shared user interface components for Bloom affordable housing system

原始使用文档
文档目录13 节
  1. Locales/Translations
  2. Storybook
  3. Testing
  4. Contributing
  5. Issue tracking
  6. Committing, Versioning, and Releasing
  7. Pull Requests
  8. Tailwind
  9. Vendor Plugins
  10. Style Conventions
  11. Naming Conventions
  12. General Rules
  13. Accessibility Considerations

Bloom UI Components

This package contains a component library used by the Bloom affordable housing system.

Locales/Translations

src/locales contains JSON files with translated keys and copy used within all of our packages.

Storybook

UIC uses Storybook to document our components, and reviewing it is the best way to get started and understand what's available. You can view our published Storybook here.

To spin up Storybook locally, from root run:

yarn start

Testing

To run the unit test suite which is built with Jest and RTL, from root run:

yarn test

or

yarn test:coverage

which generates local coverage reports.

To run our accessibility suite which leverages Storybook, from root run:

yarn test:a11y

Contributing

Contributions to UIC are welcomed. To help us meet the project's goals around quality and maintainability, we ask that all contributors read, understand, and agree to our guidelines.

Issue tracking

Our development tasks are managed through GitHub issues and development in the vast majority of cases should be tied to an issue. Please feel free to submit issues even if you don't plan on implementing them yourself. Before creating an issue, check first to see if one already exists. When creating an issue, give it a descriptive title and include screenshots if relevant. Please comment on an issue if you are starting development.

Committing, Versioning, and Releasing

We are using semantic-release to automatically versions and release. In conjunction with semantic-release we are also using conventional commits, a specification for commit messages that helps semantic-release understand what level of change each commit is in order to automate our processes.

On commit, two steps automatically run: (1) linting and (2) a verification of the conventional commit standard. If you are still learning the conventional commit standard, we recommend not running git commit and instead globally installing commitizen (npm install -g commitizen) and then committing with git cz which will run a commit message CLI. The CLI asks a series of questions about your changeset and builds the commit message for you in the conventional commit format.

On every merge to main, our published Storybook will be updated and a new version of UIC is automatically published to npm.

Pull Requests

Pull requests are opened to the main branch. When opening a pull request please fill out the entire pull request template which includes tagging the issue your PR is related to, a description of your PR, indicating the type of change, including details for the reviewer about how to test your PR, and a testing checklist.

When your PR is ready for review, add the 2 reviews needed label to surface it to our internal team. If you are the first reviewer and you approve the PR, change the label to 1 review needed, an if you request changes, change it to needs changes. Once a PR is ready, the second reviewer should update the PR with the ready to merge label. If you put up a PR that is not yet ready for eyes, add the wip label.

Once the PR has been approved, you should squash and merge. We often wait for the author to merge their own PR if they have the permissions to do so.

As a reviewer on a PR, try not to leave only comments, but a clear next step action. If the PR requires further discussion or changes, mark it with requested changes. If a PR looks good to you (or even if there are small changes requested that won't require an additional review from you), please mark it with approved and comment on the last few changes needed. This helps other reviewers better understand the state of PRs at the list view and prevents an additional unnecessary review cycle.

Tailwind

  • We are using the Tailwind framework to make use of their low-level utility classes in page-level markup and sometimes in components. We configure the settings in tailwind.config.js.

Vendor Plugins

Style Conventions

  • Our components are styled with SCSS files located alongside React component TS files.

  • We are currently in the process of migrating components to a second-generation styling convention which relies on CSS variables for internal design tokens and removes @apply Tailwind statements. V2 style components are indicated in our Storybook with a :triangular_flag_on_post:.

  • Bloom design tokens encompass many styles including colors, typography settings, sizes, border, + more.

  • More information on this migration can be found in V2Styles.md.

Naming Conventions

  • Be wary of naming components based on content, presentation, location, or theming, as this limits the use
  • Avoid including any Bloom-centered business logic in ui-components so that they may be consumed regardless of the backend implementation

General Rules

  • Don’t use IDs for styles.
  • Don’t nest more than 3 layers deep.
  • Don’t fix problems with !important. Use !important purposefully.
  • Refrain from using overqualified selectors; div.container can simply be stated as .container.
  • Use flex instead of float.
  • Use grid utilities for uniform grids.

Accessibility Considerations

  • An A11Y test suite based on our Storybook runs on all PRs
  • Checking out the Storybook AXE panel when looking at an individual component can be useful
  • Keyboard accessibility
    • Consider aria roles, focus state
  • Consider color contrast
  • Accessible forms
    • Labels for each input
    • Screen reader labels for inputs with no label
    • Fieldsets for groups
    • Required indicators
  • Accessible data tables
  • Alt tags for images
  • Errors and alert messages

版本与发布记录

@bloom-housing/ui-components 共发布 508 个版本,首次发布于 2020/03/09;过去 12 个月发布了 13 个版本。

版本发布日期距今
14.1.1latest2026/09/181 个月前
14.1.02026/07/133 个月前
14.0.22026/04/226 个月前
14.0.12026/03/107 个月前
14.0.02026/03/107 个月前
13.0.92026/03/098 个月前

其他发布通道:alpha → 12.0.10-alpha.1。

关于 @bloom-housing/ui-components 的常见问题

@bloom-housing/ui-components 是什么?

Shared user interface components for Bloom affordable housing system

如何安装 @bloom-housing/ui-components?

在项目目录运行 npm install @bloom-housing/ui-components,或使用 pnpm add / yarn add / bun add。

@bloom-housing/ui-components 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bloom-housing__ui-components 是否存在。

@bloom-housing/ui-components 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bloom-housing/ui-components 可以商用吗?

@bloom-housing/ui-components 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bloom-housing/ui-components 的下载量有多少?

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

@bloom-housing/ui-components 还在维护吗?

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