@financial-times/o-private-foundation

中文文档
1.10.0发布于 2026/03/31MITES Module零依赖近 30 天下载 3949

Foundation components for use in Origami components only.

原始使用文档
文档目录10 节
  1. Usage
  2. Behaviour
  3. Markup
  4. Sass
  5. JavaScript
  6. Troubleshooting
  7. Contributing
  8. Migration
  9. Contact
  10. Licence

o-private-foundation

:warning: NOTE: this package should ONLY be used in Origami components. If you are not developing a component that is part of Origami, please do not use this package.

A collection of Origami components for use in other Origami components.

Instructions for the component. We've broken this down by Markup, JavaScript, Sass, etc. You may add more sections as needed.

Usage

Check out how to include Origami components in your project to get started with o-private-foundation.

Behaviour

o-private-foundation Behaviour description.

Markup

Markup documentation for the component. Including css classes, data attributes, and tags for variations of the component. Demo markup is also shown in the registry. For complex markup it can be useful to describe the markup and link to the registry demos for a full example. Remember to start your codeblocks with three backticks and "html" so your markup is syntax highlighted correctly.

<div data-o-component="o-private-foundation" class='o-private-foundation'>
</div>

Sass

Sass documentation. With instructions to include styles with a primary mixin, what options are available, brand support where applicable. For complex components it may be helpful to document apis with SassDoc and link to the components SassDoc in the Origami Registry. Remember to start your codeblocks with three backticks and "scss" so your markup is syntax highlighted correctly.

Use @include oPrivateFoundation() to include styles for all o-private-foundation features.

@import "@financial-times/o-private-foundation";

@include oPrivateFoundation();

JavaScript

JavaScript documentation. Including how to initialise the component, available options, and common usecases. For complex components it may be helpful to document apis with JSDoc and link to the components JSDocs in the Origami Registry. Remember to start your codeblocks with three backticks and "js" so your js is syntax highlighted correctly.

JavaScript is initialised automatically for Origami Build Service users. If your project is using a manual build process, initialise o-private-foundation manually.

For example call the init method to initialise all o-private-foundation instances in the document:

import oPrivateFoundation from 'o-private-foundation';
oPrivateFoundation.init();

Or pass an element to initialise a specific o-private-foundation instance:

import oPrivateFoundation from 'o-private-foundation';
const oPrivateFoundationElement = document.getElementById('#my-o-private-foundation-element');
oPrivateFoundation.init(oPrivateFoundationElement);

Troubleshooting

Answers to questions or problems that come up repeatedly. It's likely you can delete this section for now. Remember to remove it from the table of contents.

Contributing

Contributing documentation for non typical components. It's likely you can delete this section if your component conforms with other components. Remember to update the table of contents is you remove this section.

Migration

Guides to upgrade from one major version of a component to another. This section includes a table of major versions with links to MIGRATION.md. MIGRATION.md would provide upgrade instructions, but since this is a new component there is no MIGRATION.md. Delete this section, including from the table of contents, until there is a second major version of this component.

StateMajor VersionLast Minor ReleaseMigration guide
✨ active3N/Amigrate to v3
⚠ maintained22.0migrate to v2
╳ deprecated11.0N/A

Contact

If you have any questions or comments about this component, or need help using it, please either raise an issue, visit #origami-support or email [email protected].

Licence

This software is published by the Financial Times under the MIT licence. `; };

版本与发布记录

@financial-times/o-private-foundation 共发布 21 个版本,首次发布于 2025/02/21;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.10.0latest2026/03/317 个月前
1.9.12026/01/1210 个月前
1.9.02025/12/0311 个月前
1.8.02025/09/181.2 年前
1.7.02025/06/231.4 年前
1.6.02025/06/101.4 年前

关于 @financial-times/o-private-foundation 的常见问题

@financial-times/o-private-foundation 是什么?

Foundation components for use in Origami components only.

如何安装 @financial-times/o-private-foundation?

在项目目录运行 npm install @financial-times/o-private-foundation,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@financial-times/o-brand(^4.2.3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@financial-times/o-private-foundation 支持 TypeScript 吗?

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

@financial-times/o-private-foundation 支持 ESM 还是 CommonJS?

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

@financial-times/o-private-foundation 可以商用吗?

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

@financial-times/o-private-foundation 的下载量有多少?

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

@financial-times/o-private-foundation 还在维护吗?

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