@rockshin/tao-icons 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +65 -110
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,172 +1,127 @@
1
- # Rounded Essentials · React + Rslib
1
+ # Tao Icons
2
2
 
3
- V13 包含 2,165 个圆角线性图标,覆盖通用界面、开发工具和保险业务。每个图标都有 React 组件、独立导入路径和原始 SVG。完整目录见 `@rockshin/tao-icons/manifest.json`。
3
+ **2,165 rounded line icons for React — made for polished products, from everyday interfaces to insurance workspaces.**
4
4
 
5
- 旧版 554 个导入名称均可继续使用。V13 在 39 个同名条目上使用了新的规范图形,旧图位于 `original-*` 路径,例如 `@rockshin/tao-icons/icons/original-chart-bar`。完整迁移表见 `@rockshin/tao-icons/migration.json`。部分保险等图标也有 V13 的绘制修订。
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
- V13 素材采用 MIT 许可,见 [ARTWORK-LICENSE](./ARTWORK-LICENSE)。npm 发布使用 `icons-v<version>` GitHub Release 触发 `release-icons.yml`。
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@0.1.1
19
+ npm install @rockshin/tao-icons
13
20
  ```
14
21
 
15
- 在已有 React 18.2+ 或 React 19 项目里安装。React 是 peer dependency(`^18.2.0 || ^19.0.0`),不包含在图标 bundle 里。此版本输出 **ESM + TypeScript 声明**,不提供 CommonJS 入口。monorepo 内使用时可以直接通过 workspace 引用,无需安装 tgz。
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} strokeWidth={1.8} />
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
- ```tsx
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
- ```tsx
49
- import { CoverageIcon, RiskScoreIcon } from '@rockshin/tao-icons';
50
- import { ProductBuilderIcon } from '@rockshin/tao-icons/icons/product-builder';
51
-
52
- export function InsuranceActions() {
53
- return <nav aria-label="保险工作台">
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 example = <SearchIcon {...props} ref={ref} title="搜索" />;
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
- 独立表达含义的图标使用 `title="搜索"` 或 `aria-label="搜索"`,默认 `role="img"`。显式 `aria-labelledby` / `aria-label` 优先于 title 的自动名称。title 默认不生成 ID,而以 `aria-label` 取同一文本,不依赖 hook、随机数或计数器;需要显式关联时才传 `titleId`。
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="搜索" titleId="header-search-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
- 显式传入的 `aria-hidden`、`role` 等仍由调用方负责;空 title 不算名称。测试覆盖 DOM/SSR 行为,未声称做过真实屏幕阅读器认证。
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
- 组件保留 `use client` 边界,Server Component 可以导入并传递可序列化 props,服务端 HTML 会输出 SVG。**这不是无需 client boundary 的原生 RSC 图标包**。
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:仍是 Server Component
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
- ### Next 16.4.2 的导入注意事项
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
- ```tsx
115
- // 根入口需要导入多个图标时,合并成同一条语句
116
- import { HomeIcon, CoverageIcon } from '@rockshin/tao-icons';
117
- // Next 项目更推荐明确的子路径
118
- import { RiskScoreIcon } from '@rockshin/tao-icons/icons/risk-score';
119
- ```
86
+ ## Migration
120
87
 
121
- 这项 Next 特定限制不会改变 React/esbuild 下 root 和 subpath 的单图标 tree-shaking 结果。harness 保留了四种干净生产构建及单独的泄漏复现报告,未把默认 Next root 导入笼统标为全部通过。额外尝试 optimizePackageImports 触发了 RSC manifest 预渲染错误,因此本版本不建议启用它作为修复。
88
+ The 554 legacy import names remain available. For 39 names whose current artwork changed, the previous artwork is available under `original-*`, for example `@rockshin/tao-icons/icons/original-chart-bar`. See `@rockshin/tao-icons/migration.json` for the full mapping.
122
89
 
123
- 需要 `ref` / `onClick` 时,调用方写在自己的 Client Component 内;不要从 Server Component 传函数或 ref。当前 Next 集成使用 16.4.2 + React 19.3.1 的生产 webpack 构建与实际生产服务器请求;未把这个结论扩展到所有 Next 版本或 Turbopack。
90
+ ## Development and verification
124
91
 
125
- ## 本地开发与 harness
92
+ 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).
126
93
 
127
- 推荐 Node 24(或 Node 22.12+)与 Bun。依赖由 monorepo 根目录的唯一锁文件 `bun.lockb` 管理,在仓库根目录执行一次 `bun install`;本包脚本在 `packages/icons` 目录内用 Bun 运行:
94
+ ---
128
95
 
129
- ```sh
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
+ ## 中文说明
135
97
 
136
- 在本包目录执行 `npm pack` 会先跑快测;只生成可安装 tgz,不发布。快测与全量检查、故障定位、fixture 维护和 CI 说明见 [HARNESS.md](./HARNESS.md)。给开发 agent 的仓库约束见 [AGENTS.md](./AGENTS.md)。
98
+ **Tao Icons 是一套为 React 产品打造的 2,165 枚圆角线性图标。** 从日常界面、数据和开发工具,到金融保险工作台,统一的视觉语言帮助团队更快构建清晰、一致的产品体验。
137
99
 
138
- 目录:
100
+ [浏览图标目录](https://rickyshin93.github.io/tao-ui/components/icons) · [npm](https://www.npmjs.com/package/@rockshin/tao-icons)
139
101
 
140
- ```text
141
- data/ 原批准 330 + 新通用 224 候选几何与 manifest
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/ 构建产物,不要手改
149
- ```
102
+ - 统一的 24px 画布、圆角描边和 `currentColor` 配色。
103
+ - 支持 React 18.2+、React 19、TypeScript、ref 和 SVG 原生属性。
104
+ - 支持根入口与逐图标导入;消费构建验证了按需打包。
105
+ - 默认作为装饰图标,也可通过 `title` 或 ARIA 属性提供无障碍名称。
106
+ - 提供 React 组件和原始 SVG,采用 MIT 许可。
150
107
 
151
- Rslib 的职责是将 TSX 编译成独立 ESM 模块、生成声明和管理 React 构建插件;设计数据与生成器保留在仓库中。`bundle: false`、每图标入口、纯调用标记与 `sideEffects: false` 一起提供按需打包条件,最终效果由真实消费构建验证。
108
+ ### 安装与使用
152
109
 
153
- 配置依据:[Rslib React 集成](https://www.rslib.rs/guide/solution/react)、[bundleless 输出目录 outBase](https://www.rslib.rs/config/lib/out-base)、[声明生成 dts](https://www.rslib.rs/config/lib/dts)。`outBase: 'src'` 与 TypeScript `rootDir` 一致,确保 JS 与声明子路径对齐。
110
+ ```sh
111
+ npm install @rockshin/tao-icons
112
+ ```
154
113
 
155
- ## 已验证与边界
114
+ ```tsx
115
+ import { SearchIcon } from '@rockshin/tao-icons';
116
+ import { ArrowRightIcon } from '@rockshin/tao-icons/icons/arrow-right';
156
117
 
157
- - 330/330 已批准 SVG 的 SHA-256 与独立旧基线一致;新通用 224 枚候选 hash 和范围记录分开保存;全部 canonical 几何与 SSR 元素属性一致
158
- - React 18.3.1 / 19.3.1:真实 tgz 安装、全部 root/subpath 导出、SSR、ref、事件与无差异 hydration
159
- - TypeScript 7.0.2:消费端 `Bundler` / `NodeNext` 两种解析,以及故意错误 props 的类型拒绝
160
- - esbuild 0.28.2:分别只引入 SearchIcon、多个保险代表及 FileSpreadsheet / ChartPie / GitPullRequest 通用代表图标,root / subpath 均只保留 1 个图标模块,剔除其余图标;React external。实际字节与 metafile 在 `artifacts/consumer-results.json`
161
- - Next App Router:生产 webpack 构建与 SSR;详细结果和限定条件在 `artifacts/next-results.json`
162
- - 不承诺 CommonJS、React Native、所有第三方框架/打包器或旧 React 版本
118
+ <button type="button" aria-label="搜索">
119
+ <SearchIcon size={20} />
120
+ </button>
121
+ ```
163
122
 
164
- ## 正式发布前
123
+ `size` 默认 24,`strokeWidth` 默认 1.8;可使用 `color`、CSS、`className` 和 SVG 属性定制。图标单独表达含义时,请设置 `title`、`aria-label` 或 `aria-labelledby`;按钮已有文字或无障碍名称时,图标保持默认的装饰状态即可。详细 API 和无障碍说明见上方英文部分。
165
124
 
166
- 1. 包名已确定为 `@rockshin/tao-icons`(scope `@rockshin`),发布前确认账号拥有权与公开范围
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 供后续版本使用
125
+ 本包输出 ESM 与 TypeScript 声明,不提供 CommonJS 入口。Next.js App Router 中图标带有 client boundary;在已测试的 Next.js 16.4.2 webpack 构建中,建议使用逐图标路径,或将根入口导入合并为一条语句,以避免引入整套图标。
171
126
 
172
- Rslib 与 React 均为各自项目的名称;本包没有声称得到它们的官方背书。
127
+ 旧版 554 个导入名称仍可使用;其中 39 个图形的旧版可通过 `original-*` 路径访问,完整映射见 `@rockshin/tao-icons/migration.json`。开发和验证命令见 [HARNESS.md](./HARNESS.md)。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rockshin/tao-icons",
3
- "version": "0.1.1",
4
- "description": "2165 rounded 24px line icons for React, with per-icon entry points and accessible defaults.",
3
+ "version": "0.1.2",
4
+ "description": "2,165 rounded line icons for React, from everyday interfaces to insurance, with TypeScript and accessible defaults.",
5
5
  "keywords": [
6
6
  "react",
7
7
  "icons",