@rockshin/tao-icons 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/DESIGN.md +1 -1
- package/HARNESS.md +3 -3
- package/README.md +62 -111
- package/data/manifest.json +18 -851
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -39
- package/package.json +2 -4
- package/data/migration.json +0 -600
- package/dist/icons/original-accessibility.d.ts +0 -5
- package/dist/icons/original-accessibility.js +0 -27
- package/dist/icons/original-arrow-left-right.d.ts +0 -5
- package/dist/icons/original-arrow-left-right.js +0 -22
- package/dist/icons/original-audio-waveform.d.ts +0 -5
- package/dist/icons/original-audio-waveform.js +0 -22
- package/dist/icons/original-battery.d.ts +0 -5
- package/dist/icons/original-battery.js +0 -29
- package/dist/icons/original-book.d.ts +0 -5
- package/dist/icons/original-book.js +0 -22
- package/dist/icons/original-briefcase.d.ts +0 -5
- package/dist/icons/original-briefcase.js +0 -29
- package/dist/icons/original-calendar-plus.d.ts +0 -5
- package/dist/icons/original-calendar-plus.js +0 -32
- package/dist/icons/original-calendar.d.ts +0 -5
- package/dist/icons/original-calendar.js +0 -25
- package/dist/icons/original-chart-bar.d.ts +0 -5
- package/dist/icons/original-chart-bar.js +0 -22
- package/dist/icons/original-clipboard-list.d.ts +0 -5
- package/dist/icons/original-clipboard-list.js +0 -36
- package/dist/icons/original-clipboard.d.ts +0 -5
- package/dist/icons/original-clipboard.js +0 -32
- package/dist/icons/original-code.d.ts +0 -5
- package/dist/icons/original-code.js +0 -22
- package/dist/icons/original-contact.d.ts +0 -5
- package/dist/icons/original-contact.js +0 -34
- package/dist/icons/original-container.d.ts +0 -5
- package/dist/icons/original-container.js +0 -22
- package/dist/icons/original-database-backup.d.ts +0 -5
- package/dist/icons/original-database-backup.js +0 -31
- package/dist/icons/original-expand.d.ts +0 -5
- package/dist/icons/original-expand.js +0 -22
- package/dist/icons/original-git-compare.d.ts +0 -5
- package/dist/icons/original-git-compare.js +0 -32
- package/dist/icons/original-layout-list.d.ts +0 -5
- package/dist/icons/original-layout-list.js +0 -43
- package/dist/icons/original-lock.d.ts +0 -5
- package/dist/icons/original-lock.js +0 -37
- package/dist/icons/original-network.d.ts +0 -5
- package/dist/icons/original-network.js +0 -37
- package/dist/icons/original-paintbrush.d.ts +0 -5
- package/dist/icons/original-paintbrush.js +0 -22
- package/dist/icons/original-picture-in-picture.d.ts +0 -5
- package/dist/icons/original-picture-in-picture.js +0 -33
- package/dist/icons/original-receipt.d.ts +0 -5
- package/dist/icons/original-receipt.js +0 -25
- package/dist/icons/original-screen-share.d.ts +0 -5
- package/dist/icons/original-screen-share.js +0 -22
- package/dist/icons/original-share.d.ts +0 -5
- package/dist/icons/original-share.js +0 -37
- package/dist/icons/original-split.d.ts +0 -5
- package/dist/icons/original-split.js +0 -29
- package/dist/icons/original-terminal.d.ts +0 -5
- package/dist/icons/original-terminal.js +0 -29
- package/dist/icons/original-user-check.d.ts +0 -5
- package/dist/icons/original-user-check.js +0 -30
- package/dist/icons/original-user-minus.d.ts +0 -5
- package/dist/icons/original-user-minus.js +0 -30
- package/dist/icons/original-user-plus.d.ts +0 -5
- package/dist/icons/original-user-plus.js +0 -30
- package/dist/icons/original-user-search.d.ts +0 -5
- package/dist/icons/original-user-search.js +0 -35
- package/dist/icons/original-user-x.d.ts +0 -5
- package/dist/icons/original-user-x.js +0 -30
- package/dist/icons/original-user.d.ts +0 -5
- package/dist/icons/original-user.js +0 -27
- package/dist/icons/original-users.d.ts +0 -5
- package/dist/icons/original-users.js +0 -27
- package/dist/icons/original-video.d.ts +0 -5
- package/dist/icons/original-video.js +0 -29
- package/dist/icons/original-volume-off.d.ts +0 -5
- package/dist/icons/original-volume-off.js +0 -25
- package/dist/icons/original-volume.d.ts +0 -5
- package/dist/icons/original-volume.js +0 -25
- package/dist/icons/original-wand.d.ts +0 -5
- package/dist/icons/original-wand.js +0 -22
- package/dist/icons/original-workflow.d.ts +0 -5
- package/dist/icons/original-workflow.js +0 -43
- package/svg/original-accessibility.svg +0 -1
- package/svg/original-arrow-left-right.svg +0 -1
- package/svg/original-audio-waveform.svg +0 -1
- package/svg/original-battery.svg +0 -1
- package/svg/original-book.svg +0 -1
- package/svg/original-briefcase.svg +0 -1
- package/svg/original-calendar-plus.svg +0 -1
- package/svg/original-calendar.svg +0 -1
- package/svg/original-chart-bar.svg +0 -1
- package/svg/original-clipboard-list.svg +0 -1
- package/svg/original-clipboard.svg +0 -1
- package/svg/original-code.svg +0 -1
- package/svg/original-contact.svg +0 -1
- package/svg/original-container.svg +0 -1
- package/svg/original-database-backup.svg +0 -1
- package/svg/original-expand.svg +0 -1
- package/svg/original-git-compare.svg +0 -1
- package/svg/original-layout-list.svg +0 -1
- package/svg/original-lock.svg +0 -1
- package/svg/original-network.svg +0 -1
- package/svg/original-paintbrush.svg +0 -1
- package/svg/original-picture-in-picture.svg +0 -1
- package/svg/original-receipt.svg +0 -1
- package/svg/original-screen-share.svg +0 -1
- package/svg/original-share.svg +0 -1
- package/svg/original-split.svg +0 -1
- package/svg/original-terminal.svg +0 -1
- package/svg/original-user-check.svg +0 -1
- package/svg/original-user-minus.svg +0 -1
- package/svg/original-user-plus.svg +0 -1
- package/svg/original-user-search.svg +0 -1
- package/svg/original-user-x.svg +0 -1
- package/svg/original-user.svg +0 -1
- package/svg/original-users.svg +0 -1
- package/svg/original-video.svg +0 -1
- package/svg/original-volume-off.svg +0 -1
- package/svg/original-volume.svg +0 -1
- package/svg/original-wand.svg +0 -1
- package/svg/original-workflow.svg +0 -1
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Rounded Essentials React 开发约束
|
|
2
2
|
|
|
3
|
-
当前目录集成 V13
|
|
3
|
+
当前目录集成 V13 SVG 素材。历史 554 枚快照保留用于独立校验;兼容旧版的 original-* 图标不进入当前包。
|
|
4
4
|
|
|
5
5
|
## 事实来源与架构
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
## 不变量
|
|
16
16
|
|
|
17
|
-
- 2,
|
|
17
|
+
- 2,126 枚、24px viewBox、1.8px currentColor 圆角线条
|
|
18
18
|
- 原 `approved-v1.2.0-*` 与 `approved-v1.3.0-preview.2-*` 独立冻结,不得为过测更新
|
|
19
19
|
- 新 `generic-candidates.json` 单独记录请求范围与完整性;不伪称设计已获最终确认
|
|
20
20
|
- 装饰性默认、显式可访问名、调用者负责 titleId 唯一性;不得随机 ID、全局计数或 useId
|
package/DESIGN.md
CHANGED
package/HARNESS.md
CHANGED
|
@@ -14,7 +14,7 @@ bun run check:extended
|
|
|
14
14
|
|
|
15
15
|
根目录 `bun install` 使用唯一的 `bun.lockb`,不要执行 `npm install` / `npm ci`。全量检查需要 npm 官方 registry 的网络访问;消费项目中的 React、类型、Next 及其传递依赖由 `tests/fixtures/*/package-lock.json` 冻结,先 `npm ci` 再安装本次 tgz,不把可变 tgz hash 写入依赖基线。需要完全离线时先准备这些 registry 依赖的 npm 缓存。新机器第一次安装/构建 Next 比快测慢。
|
|
16
16
|
|
|
17
|
-
V13 使用独立的 geometry-v13.json 校验快照。几何修订使用 geometry-refinement.1.json 记录变更 SVG 的哈希,其余图标继续使用冻结的 V13 哈希。旧版 554 个图标的 canonical 和 manifest 保存在测试 fixture
|
|
17
|
+
V13 使用独立的 geometry-v13.json 校验快照。几何修订使用 geometry-refinement.1.json 记录变更 SVG 的哈希,其余图标继续使用冻结的 V13 哈希。旧版 554 个图标的 canonical 和 manifest 保存在测试 fixture 内;39 个 original-* 兼容图标不属于当前包,其他图标继续使用冻结基线验证;`geometry-current.json` 记录当前集合及移除的名称。
|
|
18
18
|
|
|
19
19
|
## 测试分层
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ V13 使用独立的 geometry-v13.json 校验快照。几何修订使用 geometry
|
|
|
22
22
|
| --- | --- | --- |
|
|
23
23
|
| `bun run generate:check` | manifest.count 个独立 TSX 与 barrel 按 canonical 数据确定性生成,检测缺失、多余及手改文件 | 生成器或图标变更 |
|
|
24
24
|
| `bun run check` / `check:fast` | 先检查漂移,再 Rslib 构建最新 dist;类型、冻结 SVG SHA-256、SVG schema、安全属性、SSR 几何、可访问名称、ref、事件、hydration、打包 allowlist/预算 | 每次改动 |
|
|
25
|
-
| `bun run test:consumer` | 真实 npm pack 后在两个干净目录安装;React 18.3.1 / 19.3.1、全部 exports/subpaths、SSR、DOM ref/事件/hydration、TS Bundler/NodeNext;esbuild 检查 root/subpath 各只留下 1/总数 个图标;另测保险及新增通用代表图标;全部 2,
|
|
25
|
+
| `bun run test:consumer` | 真实 npm pack 后在两个干净目录安装;React 18.3.1 / 19.3.1、全部 exports/subpaths、SSR、DOM ref/事件/hydration、TS Bundler/NodeNext;esbuild 检查 root/subpath 各只留下 1/总数 个图标;另测保险及新增通用代表图标;全部 2,126 枚分别做 ref/事件、完整树 hydration 与 root/subpath 严格类型消费 | API、依赖、输出配置变更 |
|
|
26
26
|
| `bun run test:next` | 真实 tgz 安装进 Next 16.4.2;四种干净生产 webpack 构建(single root / consolidated root / separate root / subpaths)、类型、App Router 服务端页面引入 client 图标;启动生产 server,验证 HTTP 200 和 SVG 标题/尺寸 | boundary 或框架兼容变更 |
|
|
27
27
|
| `bun run check:extended` / `verify` | 上面全部顺序执行,失败立即退出 | 提交合并前、交付和发版前 |
|
|
28
28
|
| `bun run test:pack` | manifest.count 份 JS / DTS / SVG、入口映射、peer、发布身份(名称/license/非 private/非 preview 版本)、内容白名单、压缩包大小 | 打包配置改动 |
|
|
@@ -39,7 +39,7 @@ V13 使用独立的 geometry-v13.json 校验快照。几何修订使用 geometry
|
|
|
39
39
|
- API 保持具名 `*Icon`、`IconProps`、root 和 kebab-case subpath;无全局动态图标注册表
|
|
40
40
|
- `sideEffects:false`、forwardRef PURE 注解、React external 和 逐图标独立模块必须同时成立
|
|
41
41
|
- esbuild 的输出 metafile 按 `bytesInOutput` 验证每次只有所选 SearchIcon、保险或新增通用代表图标贡献代码;并非仅看输入列表或包配置
|
|
42
|
-
- 体积预算在 `tests/fixtures/budgets.json`:Search 示例 minified ≤1200 B / gzip ≤700 B,React external;2,
|
|
42
|
+
- 体积预算在 `tests/fixtures/budgets.json`:Search 示例 minified ≤1200 B / gzip ≤700 B,React external;2,126 枚 V13 tgz ≤1329000 B / unpacked ≤5667000 B;保险及新增通用单图标 minified ≤1600 B / gzip ≤850 B。Search 原预算保持不变
|
|
43
43
|
- 不把 SSR 等同于原生 RSC;Next 图标是 client boundary。根 barrel 也保留边界,Next 测试扫描客户端 chunks,检测未使用的独有几何指纹。Next 16.4.2 separate-root 两条独立导入确实会带入整套图标:该诊断情形单独报告 unusedExclusionPassed:false,不作为受支持按需导入的通过证据;single/consolidated root 与 subpath 三种情形仍严格断言零泄漏。推荐子路径或合并 root imports。Next 测试验证编译和服务端 HTML,客户端事件/hydration 由 React DOM 测试验证,没有冒称跑过浏览器端 Next E2E 或屏幕阅读器实机
|
|
44
44
|
- 包自身和 React 18/19 消费声明检查使用 `skipLibCheck: false`。Next 16.4.2 的 fixture 使用框架默认的 `skipLibCheck: true`:TS 5.9.3 下,Next 自身 `url-pattern.d.ts` 引用了缺失的全局 `URLPatternInput` / `URLPatternOptions`。这项上游声明限制已记录,不能把 Next 结果说成所有依赖声明的严格类型检查
|
|
45
45
|
|
package/README.md
CHANGED
|
@@ -1,172 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tao Icons
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**2,126 rounded line icons for React — made for polished products, from everyday interfaces to insurance workspaces.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Give your product a consistent visual language with a versatile library of 24px icons. Tao Icons pairs a clean, rounded style with practical React APIs, so you can move from idea to interface with confidence.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[Browse the icon catalog](https://rickyshin93.github.io/tao-ui/components/icons) · [npm](https://www.npmjs.com/package/@rockshin/tao-icons) · [中文说明](#中文说明)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- **A wide range of icons:** navigation, actions, files, development, data, finance and insurance.
|
|
10
|
+
- **Designed to work together:** a consistent 24px canvas, rounded strokes and `currentColor` styling.
|
|
11
|
+
- **Ready for React:** named components, TypeScript types, refs and native SVG props for React 18.2+ and 19.
|
|
12
|
+
- **Import what you need:** root exports and explicit per-icon entry points, with tree-shaking verified in consumer builds.
|
|
13
|
+
- **Accessible by default:** decorative unless named, with support for `title` and ARIA attributes.
|
|
14
|
+
- **Flexible assets:** use the React components or the included SVG files. MIT licensed.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
10
17
|
|
|
11
18
|
```sh
|
|
12
|
-
npm install @rockshin/tao-icons
|
|
19
|
+
npm install @rockshin/tao-icons
|
|
13
20
|
```
|
|
14
21
|
|
|
15
|
-
|
|
22
|
+
React is a peer dependency (`^18.2.0 || ^19.0.0`). The package provides ESM and TypeScript declarations; it does not provide a CommonJS entry point.
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
16
25
|
|
|
17
26
|
```tsx
|
|
18
27
|
import { SearchIcon, HomeIcon } from '@rockshin/tao-icons';
|
|
19
|
-
// 显式单图标入口(kebab-case;没有 .js 后缀)
|
|
20
28
|
import { ArrowRightIcon } from '@rockshin/tao-icons/icons/arrow-right';
|
|
21
29
|
|
|
22
30
|
export function Toolbar() {
|
|
23
31
|
return (
|
|
24
|
-
<button type="button" aria-label="
|
|
25
|
-
<SearchIcon size={20}
|
|
32
|
+
<button type="button" aria-label="Search">
|
|
33
|
+
<SearchIcon size={20} />
|
|
26
34
|
</button>
|
|
27
35
|
);
|
|
28
36
|
}
|
|
29
37
|
```
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
Use kebab-case names without a `.js` suffix for per-icon imports. Browse the catalog or the included `@rockshin/tao-icons/manifest.json` for the complete set.
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
import { FileSpreadsheetIcon, ChartPieIcon } from '@rockshin/tao-icons';
|
|
35
|
-
import { GitPullRequestIcon } from '@rockshin/tao-icons/icons/git-pull-request';
|
|
36
|
-
|
|
37
|
-
export function CommonActions() {
|
|
38
|
-
return <nav aria-label="常用操作">
|
|
39
|
-
<button><FileSpreadsheetIcon size={20} />表格文件</button>
|
|
40
|
-
<button><ChartPieIcon size={20} />占比图</button>
|
|
41
|
-
<button><GitPullRequestIcon size={20} />合并请求</button>
|
|
42
|
-
</nav>;
|
|
43
|
-
}
|
|
44
|
-
```
|
|
41
|
+
## Customize
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
Each icon is a named `*Icon` export. Import `IconProps` from the root when you need the shared type.
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<button><CoverageIcon size={20} />保障责任</button>
|
|
55
|
-
<button><RiskScoreIcon size={20} />风险评分</button>
|
|
56
|
-
<button><ProductBuilderIcon size={20} />产品配置</button>
|
|
57
|
-
</nav>;
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
新增图标是用于导航、按钮、流程状态和数据项的视觉候选;具体金融业务含义以系统文案和业务规则为准,不应单独依靠图形区分审批/支付状态。所有新增导出继续遵循同一 IconProps 和单图标子路径约定。
|
|
62
|
-
|
|
63
|
-
## API
|
|
64
|
-
|
|
65
|
-
每个组件用 `*Icon` 具名导出。可从根入口导入 `IconProps` 类型。
|
|
66
|
-
|
|
67
|
-
- `size?: number | string`,默认 24,同时设置宽高;显式 `width` / `height` 优先
|
|
68
|
-
- `color` 或 CSS `color` 控制默认 `currentColor`;`strokeWidth` 默认 1.8
|
|
69
|
-
- `className`、`style`、SVG 属性、`aria-*`、`data-*` 和事件处理器可直接传入
|
|
70
|
-
- `ref` 指向实际 `SVGSVGElement`,React 18/19 都支持
|
|
71
|
-
- `title?: string` 渲染 SVG title,并在没有显式 ARIA 名称时提供可访问名称
|
|
72
|
-
- `titleId?: string` 可选;提供时连接 title 与 `aria-labelledby`。调用方须保证页面内唯一
|
|
73
|
-
- `children` 追加在图标几何后;`dangerouslySetInnerHTML` 不支持,以保护固定子元素结构
|
|
45
|
+
- `size?: number | string` sets width and height (default `24`); explicit `width` and `height` take precedence.
|
|
46
|
+
- `color` or CSS `color` controls the default `currentColor`; `strokeWidth` defaults to `1.8`.
|
|
47
|
+
- Pass `className`, `style`, SVG attributes, `aria-*`, `data-*` and event handlers directly.
|
|
48
|
+
- `ref` points to the underlying `SVGSVGElement`.
|
|
49
|
+
- `title` supplies an accessible name when no explicit ARIA name is present. `titleId` optionally associates the title via `aria-labelledby`; keep it unique on the page.
|
|
50
|
+
- `children` are appended after the icon geometry. `dangerouslySetInnerHTML` is not supported.
|
|
74
51
|
|
|
75
52
|
```tsx
|
|
76
|
-
import { createRef } from 'react';
|
|
77
53
|
import { SearchIcon, type IconProps } from '@rockshin/tao-icons';
|
|
78
54
|
|
|
79
|
-
const ref = createRef<SVGSVGElement>();
|
|
80
55
|
const props: IconProps = { size: '1em', color: '#275EFE' };
|
|
81
|
-
const
|
|
56
|
+
const icon = <SearchIcon {...props} title="Search" />;
|
|
82
57
|
```
|
|
83
58
|
|
|
84
|
-
###
|
|
85
|
-
|
|
86
|
-
不提供名称时默认装饰性:`aria-hidden="true"`、`focusable="false"`。按钮里已有文字或按钮本身有 `aria-label` 时,让图标保持装饰性。
|
|
59
|
+
### Accessibility
|
|
87
60
|
|
|
88
|
-
|
|
61
|
+
Icons without a name are decorative by default (`aria-hidden="true"`, `focusable="false"`). Leave an icon decorative when its button already has visible text or an accessible label. For an icon that conveys meaning on its own, provide `title`, `aria-label`, or `aria-labelledby`; named icons default to `role="img"`. An explicit ARIA name takes precedence over the title. An empty title does not provide a name. Explicit `aria-hidden` and `role` remain the caller's responsibility.
|
|
89
62
|
|
|
90
63
|
```tsx
|
|
91
|
-
<SearchIcon title="
|
|
92
|
-
<SearchIcon title="
|
|
64
|
+
<SearchIcon title="Search" />
|
|
65
|
+
<SearchIcon title="Search" titleId="header-search-title" />
|
|
93
66
|
<SearchIcon aria-labelledby="visible-search-label" />
|
|
94
67
|
```
|
|
95
68
|
|
|
96
|
-
|
|
69
|
+
DOM and SSR behavior is tested; real screen-reader certification has not been performed. Do not rely on icons alone to communicate financial or approval status.
|
|
97
70
|
|
|
98
71
|
## Next.js App Router
|
|
99
72
|
|
|
100
|
-
|
|
73
|
+
Icons retain a `use client` boundary. A Server Component can import an icon and pass serializable props, and the SVG is rendered in server HTML. Use your own Client Component for refs or event handlers.
|
|
101
74
|
|
|
102
75
|
```tsx
|
|
103
|
-
// app/page.tsx
|
|
76
|
+
// app/page.tsx — a Server Component
|
|
104
77
|
import { HomeIcon } from '@rockshin/tao-icons/icons/home';
|
|
78
|
+
|
|
105
79
|
export default function Page() {
|
|
106
|
-
return <HomeIcon title="
|
|
80
|
+
return <HomeIcon title="Home" />;
|
|
107
81
|
}
|
|
108
82
|
```
|
|
109
83
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
优先使用上例的逐图标子路径。测试发现:同一 Server Component 中,用两条独立语句从根入口导入不同图标,会让 Next 16.4.2 的 client chunk 意外包含整套图标。把 root named imports 合并为一条语句,或全部使用单图标子路径,已验证不带入无关图标。
|
|
84
|
+
In the tested Next.js 16.4.2 production webpack build, separate root import statements in one Server Component can include the entire icon set in the client chunk. Prefer per-icon paths, or combine root imports into one statement. This result does not establish behavior for every Next.js version or Turbopack. These components use a client boundary; they are not native server-only RSC icons.
|
|
113
85
|
|
|
114
|
-
|
|
115
|
-
// 根入口需要导入多个图标时,合并成同一条语句
|
|
116
|
-
import { HomeIcon, CoverageIcon } from '@rockshin/tao-icons';
|
|
117
|
-
// Next 项目更推荐明确的子路径
|
|
118
|
-
import { RiskScoreIcon } from '@rockshin/tao-icons/icons/risk-score';
|
|
119
|
-
```
|
|
86
|
+
## Development and verification
|
|
120
87
|
|
|
121
|
-
|
|
88
|
+
From the repository root, install dependencies with `bun install`. In `packages/icons`, run `bun run check` for generation, build, type, behavior and package checks, or `bun run check:extended` for real-tarball React 18/19 and Next.js consumer checks. See [HARNESS.md](./HARNESS.md) for the test matrix and known limitations. Code and artwork are covered by the [MIT license](./ARTWORK-LICENSE).
|
|
122
89
|
|
|
123
|
-
|
|
90
|
+
---
|
|
124
91
|
|
|
125
|
-
##
|
|
92
|
+
## 中文说明
|
|
126
93
|
|
|
127
|
-
|
|
94
|
+
**Tao Icons 是一套为 React 产品打造的 2,126 枚圆角线性图标。** 从日常界面、数据和开发工具,到金融保险工作台,统一的视觉语言帮助团队更快构建清晰、一致的产品体验。
|
|
128
95
|
|
|
129
|
-
|
|
130
|
-
bun install # 仓库根目录:安装全部 workspace
|
|
131
|
-
bun run check # 生成漂移 → 最新构建 → 类型/几何/SSR/DOM/包内容
|
|
132
|
-
bun run check:extended # 再加真实 tgz 消费、React 18/19、tree-shaking、Next
|
|
133
|
-
npm pack --pack-destination artifacts
|
|
134
|
-
```
|
|
96
|
+
[浏览图标目录](https://rickyshin93.github.io/tao-ui/components/icons) · [npm](https://www.npmjs.com/package/@rockshin/tao-icons)
|
|
135
97
|
|
|
136
|
-
|
|
98
|
+
- 统一的 24px 画布、圆角描边和 `currentColor` 配色。
|
|
99
|
+
- 支持 React 18.2+、React 19、TypeScript、ref 和 SVG 原生属性。
|
|
100
|
+
- 支持根入口与逐图标导入;消费构建验证了按需打包。
|
|
101
|
+
- 默认作为装饰图标,也可通过 `title` 或 ARIA 属性提供无障碍名称。
|
|
102
|
+
- 提供 React 组件和原始 SVG,采用 MIT 许可。
|
|
137
103
|
|
|
138
|
-
|
|
104
|
+
### 安装与使用
|
|
139
105
|
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
svg/ 原批准 330 份 SVG 字节不变 + 新通用 224 SVG
|
|
143
|
-
scripts/generate.mjs 生成器
|
|
144
|
-
src/icons/ 每图标独立生成的 React 组件
|
|
145
|
-
src/icon-props.ts 共享的纯 props / accessibility helper
|
|
146
|
-
rslib.config.ts ESM、非合并构建、类型声明、React external
|
|
147
|
-
tests/ 单元、golden、包消费和 Next 测试
|
|
148
|
-
dist/ 构建产物,不要手改
|
|
106
|
+
```sh
|
|
107
|
+
npm install @rockshin/tao-icons
|
|
149
108
|
```
|
|
150
109
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
## 已验证与边界
|
|
110
|
+
```tsx
|
|
111
|
+
import { SearchIcon } from '@rockshin/tao-icons';
|
|
112
|
+
import { ArrowRightIcon } from '@rockshin/tao-icons/icons/arrow-right';
|
|
156
113
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- Next App Router:生产 webpack 构建与 SSR;详细结果和限定条件在 `artifacts/next-results.json`
|
|
162
|
-
- 不承诺 CommonJS、React Native、所有第三方框架/打包器或旧 React 版本
|
|
114
|
+
<button type="button" aria-label="搜索">
|
|
115
|
+
<SearchIcon size={20} />
|
|
116
|
+
</button>
|
|
117
|
+
```
|
|
163
118
|
|
|
164
|
-
|
|
119
|
+
`size` 默认 24,`strokeWidth` 默认 1.8;可使用 `color`、CSS、`className` 和 SVG 属性定制。图标单独表达含义时,请设置 `title`、`aria-label` 或 `aria-labelledby`;按钮已有文字或无障碍名称时,图标保持默认的装饰状态即可。详细 API 和无障碍说明见上方英文部分。
|
|
165
120
|
|
|
166
|
-
|
|
167
|
-
2. 核对代码的 LICENSE 与素材的 ARTWORK-LICENSE,确认公开分发授权
|
|
168
|
-
3. 确认发布版本(当前 `0.1.1`),同步包名示例与测试,再运行 `bun run release:check`
|
|
169
|
-
4. `bun install && bun run check:extended`,检查 `npm pack --dry-run` 与实际 tgz 安装
|
|
170
|
-
5. 在明确批准发布后,创建 GitHub Release `icons-v<version>` 触发 `release-icons.yml`;新包首次发布会进入 npm staged publishing,需维护者用 2FA 在 Staged Packages 批准,之后可在 npmjs 配置 trusted publisher 供后续版本使用
|
|
121
|
+
本包输出 ESM 与 TypeScript 声明,不提供 CommonJS 入口。Next.js App Router 中图标带有 client boundary;在已测试的 Next.js 16.4.2 webpack 构建中,建议使用逐图标路径,或将根入口导入合并为一条语句,以避免引入整套图标。
|
|
171
122
|
|
|
172
|
-
|
|
123
|
+
开发和验证命令见 [HARNESS.md](./HARNESS.md)。
|