@ebury/chameleon-components

中文文档
2.8.26发布于 2025/10/22MITCommonJS近 30 天下载 2081

Chameleon Components is Ebury's vue.js 3.X components library. The library is being used for our Vue projects at Ebury, and more components are added regularly.

原始使用文档
文档目录15 节
  1. Installation
  2. Contributing
  3. Usage
  4. Install the library in your project
  5. Import component/s
  6. Theming
  7. I18n
  8. References
  9. Vue.js
  10. TypeScript
  11. Storybook
  12. Testing
  13. Linting
  14. CSS
  15. Dependencies

Chameleon Components

Chameleon Components is Ebury's vue.js 3.X components library. The library is being used for our Vue projects at Ebury, and more components are added regularly.

Also, check out the latest version deployed in Storybook.

  1. Vision
  2. Contributing
  3. Code Owners
  4. Installation
  5. Usage
  6. Theming
  7. I18n
  8. References

Installation

If you'd like to contribute to the library then you must do the following to set up your local environment:

1. Clone chameleon-components repo

2. Install all dependencies with:

npm install

3. Run Storybook with:

npm start

That's it! By now, you should be up and running. You can check the existing components or create new ones.

Contributing

We love collaborating with other teams and welcome contributions!

See the contributing docs for more info on code style, formatting, testing, and troubleshooting. Or if you want to report a problem or request some change.

Usage

Install the library in your project

Install @ebury/chameleon-components in your project with npm:

npm install @ebury/chameleon-components --save

Import component/s

All of our components are exported by name from @ebury/chameleon-components, so you can import them with:

import { ComponentName } from '@ebury/chameleon-components';

NOTE! If you are going to use ec-phone-number-input, you must host icons from node_modules/svg-country-flags/png100px/ in your project.

For example icon with path node_modules/svg-country-flags/png100px/gb.png should be available in your project by url [your static prefix]icons/country-flags/100/gb.png. Static prefix could be change by setting up respective iconsStaticPrefix property in src/config.js.

Theming

The components can use a custom theme. There are four color palettes used by the CSS, two of them can be adjusted via CSS variables, e.g. the default blue color is defined as --ec-key-color-level-4 and can be configured via --ec-theme-key-color-level-4.

Check out the list of possible variables in the storybook colors story.

A few examples of a theme can be found in the src/styles/themes/ folder.

I18n

Some components, e.g. ec-amount-input or ec-donut require Intl API to format values properly or to detect what is the decimal/grouping separator for a current locale. They both do that via Intl.NumberFormat which might have issues in some browsers for not having all locales set up properly. See the issues we discovered in this PR. If you need to support every single locale on the planet, we recommend to polyfill the Intl API using formatjs.io packages so it's consistent across all browsers.

References

Vue.js

Vue

Vite

TypeScript

TypeScript

Storybook

Storybook

Testing

Vitest

Vue Test Utils

Cypress

Linting

ESLint

Stylelint

CSS

PostCSS

TailwindCSS

Bootstrap Grid

Dependencies

VueUse

flatpickr

focus-trap

floating-vue

svg-country-flags

版本与发布记录

@ebury/chameleon-components 共发布 390 个版本,首次发布于 2019/09/28;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.8.26latest2025/10/221.1 年前
2.8.252025/08/141.3 年前
2.8.242025/07/071.4 年前
2.8.222025/04/031.6 年前
2.8.212025/03/061.7 年前
2.8.202025/03/031.7 年前

关于 @ebury/chameleon-components 的常见问题

@ebury/chameleon-components 是什么?

Chameleon Components is Ebury's vue.js 3.X components library. The library is being used for our Vue projects at Ebury, and more components are added regularly.

如何安装 @ebury/chameleon-components?

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

@ebury/chameleon-components 支持 TypeScript 吗?

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

@ebury/chameleon-components 支持 ESM 还是 CommonJS?

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

@ebury/chameleon-components 需要什么版本的 Node.js?

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

@ebury/chameleon-components 可以商用吗?

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

@ebury/chameleon-components 的下载量有多少?

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

@ebury/chameleon-components 还在维护吗?

最新版本 2.8.26 发布于 2025/10/22(1.1 年前);至今共发布 390 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/09/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。