@buoy-gg/shared-ui

中文文档
7.0.87发布于 2026/11/07TypeScriptESM + CJS近 30 天下载 8万

Shared UI components, hooks, and utilities

原始使用文档
文档目录4 节
  1. Install
  2. Public entry points
  3. Account setup
  4. Custom floating tools

@buoy-gg/shared-ui

Shared components, colors, hooks, and utilities used by Buoy's React Native tools. Use this package when implementing a custom tool or a compatible internal interface. To install the existing tool suite, start with @buoy-gg/core.

Install

npm install @buoy-gg/shared-ui

Keep peer dependencies compatible with your other Buoy packages, including the license package. This is the @buoy-gg scope.

Public entry points

Saved web windows keep their top edge, like native windows.

ImportContents
@buoy-gg/shared-uiMain component and utility exports.
@buoy-gg/shared-ui/colorsPalette exports for initialization before component modules load.
@buoy-gg/shared-ui/uiUI components and styling helpers.
@buoy-gg/shared-ui/hooksShared hooks.
@buoy-gg/shared-ui/utilsUtility functions.
@buoy-gg/shared-ui/dataViewerData inspection components.
@buoy-gg/shared-ui/historyHistory-related exports.

For example, read the shared palette through its dedicated entry point:

import { macOSColors } from "@buoy-gg/shared-ui/colors";

const panelBackground = macOSColors.background.card;

Use the installed declarations to select components and their props. Avoid private source imports. Some components and stores depend on account state or provider context; importing a primitive does not initialize the surrounding tool lifecycle.

Follow the custom-tool guide to register a tool and its adapter. Verify your panel with empty data, a known populated state, and the supported app theme before connecting remote actions.

Account setup

AccountSetup shows the sign-in launcher when Buoy needs a verified account. Native and web use the same launcher and account card, including the copyable login command, connection feedback, and support links. The web card opens above the launcher and closes with Escape, its close button, or a click outside. FreeAccountPrompt presents the card in a native modal.

Custom floating tools

FloatingTool provides the same drag, hide/restore and position behavior used by the DevTools bubble. Use FloatingToolHost with openFloatingTool to keep compact custom controls mounted across navigation. Each tool supplies its own content and actions. Set dragFromSurface to make the background draggable while buttons keep their gestures; the default uses the grip only.

See the custom floating tools guide for native and browser integration, lifecycle rules and examples. Browser consumers can import the dedicated @buoy-gg/shared-ui/floating entry.

In browser panels, header dragging starts on non-interactive space. Buttons, tabs, inputs, and other focusable controls keep their pointer input. Window controls have 24 px hit areas.

Web action bars honor a bottom start spot. Saved spots still win. Web menus and modals stay above the tool windows.

版本与发布记录

@buoy-gg/shared-ui 共发布 120 个版本,首次发布于 2026/01/04;过去 12 个月发布了 120 个版本。

版本发布日期距今
7.0.87latest2026/11/071 天前
7.0.862026/11/062 天前
7.0.852026/11/053 天前
7.0.842026/11/035 天前
7.0.832026/11/035 天前
7.0.822026/11/036 天前

其他发布通道:beta → 2.1.4-beta.2。

关于 @buoy-gg/shared-ui 的常见问题

@buoy-gg/shared-ui 是什么?

Shared UI components, hooks, and utilities

如何安装 @buoy-gg/shared-ui?

在项目目录运行 npm install @buoy-gg/shared-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、@buoy-gg/license(7.0.87)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@buoy-gg/shared-ui 支持 TypeScript 吗?

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

@buoy-gg/shared-ui 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@buoy-gg/shared-ui 可以商用吗?

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

@buoy-gg/shared-ui 的下载量有多少?

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

@buoy-gg/shared-ui 还在维护吗?

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