@thetaskforge/design-system

中文文档
0.6.1发布于 2026/11/02UNLICENSEDES Module零依赖

Taskforge design system (Untitled UI based): components, hooks, utils and styles shared by every Taskforge frontend.

原始使用文档
文档目录10 节
  1. Using it in an app
  2. Releasing a new version to npm
  3. Method 1: Single command from terminal (Recommended)
  4. Method 2: From GitHub Actions Web UI
  5. Method 3: Direct npm publish
  6. Shared libraries (Module Federation)
  7. Application (whole-screen pieces)
  8. Base (small building blocks)
  9. Hooks / utils
  10. Rules

Taskforge design system (Untitled UI based)

@thetaskforge/design-system is the single copy used by every Taskforge frontend. Change a component here, tag a release, and bump it in the apps. Folder: src/components/<group>/<name>/.

Using it in an app

  1. Install from npm:
    npm install @thetaskforge/design-system
    
  2. Keep imports as they are by aliasing @/design-system to node_modules/@thetaskforge/design-system/src in tsconfig.json (paths) and the webpack resolve.alias.
  3. Let webpack compile the package's TypeScript: include node_modules/@thetaskforge/design-system in the TS/babel rule.
  4. In the app's index.scss, import @thetaskforge/design-system/styles/globals.css and add @source "../node_modules/@thetaskforge/design-system/src"; so Tailwind sees the classes.
  5. Add the peer dependencies in package.json and mark them singleton in Module Federation's shared.

Note: Because this package is published to the public npm registry under the @thetaskforge scope, no special Git tokens or repository credentials are required for npm install in Docker, CI/CD, or Vercel.

Releasing a new version to npm

Run any of the following:

npm run release:patch    # e.g. 0.3.24 -> 0.3.25
npm run release:minor    # e.g. 0.3.24 -> 0.4.0
npm run release:major    # e.g. 0.3.24 -> 1.0.0

This automatically bumps package.json, commits, creates the git tag, and pushes to GitHub. The GitHub Actions workflow (.github/workflows/publish.yml) runs typechecks, tests, and publishes directly to npm.

Method 2: From GitHub Actions Web UI

  1. Go to the Actions tab in GitHub.
  2. Select Publish to npm from the left sidebar.
  3. Click Run workflow, choose patch, minor, or major, and click Run workflow.

Method 3: Direct npm publish

npm publish

Shared libraries (Module Federation)

Every app lists react-aria-components, react-aria, react-stately and @internationalized/date as singleton shared libraries, next to React and React Router. That keeps one copy of the libraries holding the design system's contexts, so the host's router and overlay contexts reach components that come from another app. Keep their versions identical across apps.

Application (whole-screen pieces)

ComponentUse it for
app-navigationSidebar, header and mobile navigation
breadcrumbs/BreadcrumbsThe trail of pages above the current one
page-header/PageHeaderPage title, description, badge, breadcrumbs and action buttons
steps/StepsStages of a process (horizontal or vertical)
metrics/MetricCardA number with a label (and note, icon)
table/TableData tables (scrollClassName, scrollOrientation options)
tabs, pagination, date-picker, empty-state, loading-indicator, file-upload, carousel, chartsAs named
modals/ModalShell, modals/ConfirmActionModalDialogs and "Are you sure?" confirmations
slideout-menus/SlideoutMenu, slideout-menus/DrawerSide panels. Drawer stays mounted so it can slide, with title, subtitle and footer
toastNotices such as "Link copied"
slideout-menus/DockedPanelA non-modal panel beside the page (no backdrop) for the settings of what is selected
floating-toolbar/FloatingToolbar, FloatingToolbarButton, FloatingToolbarDividerA collapsible pill of icon actions floating over a canvas
floating-action-button/FloatingActionButton, AnchoredPopupA big round draggable button and the popup that opens beside it, flipping to stay on screen
command-menu/CommandMenuSearchable, sectioned list with a fixed search and a scrolling body
workflow-canvas/PalettePanel, PaletteItemIcon-only draggable shortcuts with tooltips
workflow-canvas/WorkflowNodeCard, NodeHandle, CanvasGroup, EdgeLabel, CanvasPanel, ZoomControlsPieces of a flow canvas: step cards, stage groups, connector labels, zoom
workflow-canvas/CanvasGroup (states default / new / drop, isEditingName, menu), GroupMenu, CollapsedGroupCardStages: the box, naming it, drop highlight, its menu (Rename, colour, Collapse, Ungroup) and the folded card
workflow-canvas/SelectionBox, SelectionBar, SelectionBarButton, SelectionBarDividerThe rectangle over picked steps and the dark bar above them (Group steps, Align, Delete)
sortable-list/SortableListRows reordered by drag handle or keyboard
condition-row/ConditionRow, ConditionJoinA condition as a sentence, with And / Or
problem-card/ProblemCardOne finding from a check, with a jump-to button
version-row/VersionRowLive, draft, past and grouped-autosave lines of a history
timeline/TimelineColoured events along one line of time
rich-text-editor/RichTextEditorSmall HTML message editor: bold, italic, link, list

Base (small building blocks)

ComponentUse it for
accordion/AccordionHeadings that open to show content
badges/Badge, badges/StatusBadgeLabels. StatusBadge maps a status word to a colour (override with tones)
buttons/Button, ButtonUtility, CloseButtonActions, icon buttons
input/Input, InputNumber, InputDate, PinInput, InputTags, CopyFieldFields. CopyField is the grey read-only field with a copy icon
select/Select, ComboBox, MultiSelect, TagSelect, SelectNativePickers. ComboBox is the searchable one
segmented/SegmentedTwo-to-four option switch (Canvas / List, And / Or)
reference-chip/ReferenceChipA value, destination or missing reference shown as a chip
code-block/CodeBlockRead-only code with copy
toggle/Toggle, toggle/ToggleRowOn/off switch, and a switch with title and explanation
avatar, card, checkbox, dropdown, radio-buttons, slider, textarea, tags, tooltip, banner, button-group, progress-indicators, skeleton, scroll-area, formAs named

Hooks / utils

use-breakpoint, use-clipboard, use-persisted-state, cx, timezones, anchored-placement/computeBesidePlacement, group-bounds/getGroupBounds, isCentreInside.

Rules

  • Reach for these before writing a local component. If something is missing, add it here.
  • Light mode only for mocks; use container queries rather than viewport variants inside builders and public pages.

版本与发布记录

@thetaskforge/design-system 共发布 6 个版本,首次发布于 2026/10/26;过去 12 个月发布了 6 个版本。

版本发布日期距今
0.6.1latest2026/11/02今天
0.6.02026/10/304 天前
0.5.02026/10/286 天前
0.4.02026/10/268 天前
0.3.252026/10/268 天前
0.0.0-stage2026/10/268 天前

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

@thetaskforge/design-system 是什么?

Taskforge设计系统(基于未命名的UI):每个Taskforge前端共享的组件、钩子、utils和样式。

如何安装 @thetaskforge/design-system?

在项目目录运行 npm install @thetaskforge/design-system,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0)、motion(^12.43.0)、recharts(^3.10.1)、input-otp(^1.5.0)、react-dom(^18.2.0)、react-aria(^3.52.1)、tailwindcss(^4.3.3)、react-stately(^3.50.0)、@iconify/react(^5.0.2)、tailwind-merge(^3.6.0)、qr-code-styling(^1.9.2)、react-router-dom(^6.30.0)、@react-aria/utils(^3.34.1)、@untitledui/icons(^0.0.22)、@react-types/shared(^3.36.1)、tailwindcss-animate(^1.0.7)、@react-stately/utils(^3.12.1)、embla-carousel-react(^8.6.0)、@react-types/overlays(^3.10.0)、react-aria-components(^1.21.1)、@untitledui/file-icons(^0.0.9)、@internationalized/date(^3.12.4)、@tailwindcss/typography(^0.5.20)、@radix-ui/react-scroll-area(^1.2.18)、tailwindcss-react-aria-components(^2.2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@thetaskforge/design-system 支持 TypeScript 吗?

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

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

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

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

@thetaskforge/design-system 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

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

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