@claudebernard/design-system

中文文档
2.40.0发布于 2026/10/26TypeScriptES Module近 30 天下载 5409

Storybook

原始使用文档
文档目录12 节
  1. How to install it via NPM ?
  2. Install the package
  3. Import components
  4. Import CSS utilities
  5. Development
  6. Development server
  7. Lint project
  8. How to create a new component ?
  9. How to create a new story ?
  10. How to add new icon ?
  11. How to add new theme ?
  12. Versioning, releasing, publishing

Design System

Storybook

This project is the design system used on Claude Bernard tools

How to install it via NPM ?

Install the package

npm install @claudebernard/design-system

Import components

There are two ways to import components:

  • You can import all components at once, this means you will import all design system in your project.
import '@claudebernard/design-system';
  • You can import only the components you need, example:
import '@claudebernard/design-system/button';

Then you can use components in your project

Import CSS utilities

The design system provides a set of CSS utility classes (similar to Bootstrap) for spacing, display, flexbox, text, and gap. Import the standalone stylesheet:

import '@claudebernard/design-system/style/utilities.css';

The utilities are also automatically available inside design system components.

Development

Development server

Run npm run storybook to run Storybook. Navigate to http://localhost:6006/. The app will automatically reload if you change any of the source files.

Lint project

Run npm run lint to run Eslint.

How to create a new component ?

  1. Create a new folder in src/components with the name of your component
  2. Create three files: src/components/your-component/your-component.ts, src/components/your-component/your-component.spec.ts and src/components/your-component/your-component.scss in this folder
  3. Create a new file src/components/your-component/index.ts in this folder that will export your component
  4. Add export of your component in src/index.ts to allow import unique component
  5. Create a new entrypoint of your component in vite.config.ts
  6. Add export of your component in package.json to allow import unique component

How to create a new story ?

  1. Create a new file src/components/your-component/your-component.stories.ts with the stories of your component, and it will be automatically imported in Storybook

How to add new icon ?

  1. Add your svg icon in src/icons/svg folder
  2. Complete the src/icons/index.ts file with the new icon information

How to add new theme ?

  1. Add your new theme in src/themes folder with the name of your theme (e.g. src/themes/${your-theme-name}.scss)
  2. Add your theme in package.json to allow import unique theme (e.g. "./style/${your-theme-name}": "./dist/style/${your-theme-name}.css")
  3. Add your theme in vite.config.ts to allow vite to build your theme
  4. Add your theme in storybook preview.js to allow storybook to use your theme

Versioning, releasing, publishing

Versioning and releasing is managed in CI with semantic-release.

To make a release, merge your commits on master branch.

版本与发布记录

@claudebernard/design-system 共发布 158 个版本,首次发布于 2024/09/18;过去 12 个月发布了 54 个版本。

版本发布日期距今
2.40.0latest2026/10/2614 天前
2.39.42026/10/2218 天前
2.39.32026/10/071 个月前
2.39.22026/10/061 个月前
2.39.12026/10/021 个月前
2.39.02026/10/021 个月前

关于 @claudebernard/design-system 的常见问题

如何安装 @claudebernard/design-system?

在项目目录运行 npm install @claudebernard/design-system,或使用 pnpm add / yarn add / bun add。

@claudebernard/design-system 支持 TypeScript 吗?

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

@claudebernard/design-system 支持 ESM 还是 CommonJS?

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

@claudebernard/design-system 可以商用吗?

@claudebernard/design-system 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@claudebernard/design-system 的下载量有多少?

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

@claudebernard/design-system 还在维护吗?

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