knowidea-icons 0.8.0 → 0.9.0
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/README.md +24 -87
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,103 +1,40 @@
|
|
|
1
1
|
# knowidea-icons
|
|
2
2
|
|
|
3
|
-
UI
|
|
3
|
+
KNOW IDEA UI のアイコン。133 個。形は Phosphor の regular。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[ドキュメント](https://takikou347.github.io/knowidea-ui/) / [GitHub](https://github.com/takikou347/knowidea-ui) / MIT
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
| --- | --- | --- | --- | --- |
|
|
9
|
-
| Phosphor | `@phosphor-icons/core` | 2.1.1 | MIT | 太さ 6 種(thin、light、regular、bold、fill、duotone)。regular は 256 の枠に 16、24px で 1.5px |
|
|
10
|
-
| Tabler | `@tabler/icons` | 3.49.0 | MIT | outline、filled。線 2px(24px の枠) |
|
|
11
|
-
| Lucide | `lucide-static` | 1.55.0 | ISC(Feather 由来の一部は MIT) | 線 2px(24px の枠)。太さは変数で変えられる |
|
|
7
|
+
## 入れる
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
| 理由 | 内容 |
|
|
18
|
-
| --- | --- |
|
|
19
|
-
| 線の太さ | 20px で 1.25px、16px で 1px。方向 B の本文(IBM Plex Sans JP 400、14px の縦線が約 1.1px)と同じ重さ。Tabler と Lucide は 20px で 1.67px、16px で 1.33px で、文字より 1 段重い |
|
|
20
|
-
| ウェイトを選べる | 同じ形のまま light と bold に変えられる。Tabler と Lucide は線の太さを後から変えるしかない |
|
|
21
|
-
| 形 | 角が小さく、方向 B の小さな角丸に合う。外へのリンクと更新は Phosphor が一番すっきりしている |
|
|
22
|
-
| 注意 | 16px の regular は細い。小さな所は 16px を避け、20px を既定にする。16px が要る所(表の中の印)は bold を試す |
|
|
23
|
-
|
|
24
|
-
別を推す場合: 線の太さを 2px 前後にしたい画面(ダークで細い線が潰れる、など)は Lucide。Phosphor と混ぜない。
|
|
25
|
-
|
|
26
|
-
## 使い方
|
|
27
|
-
|
|
28
|
-
| 決まり | 中身 |
|
|
29
|
-
| --- | --- |
|
|
30
|
-
| サイズ | 20px がデフォルト、表の中は 16px。24px 以上は使わない |
|
|
31
|
-
| 色 | `currentColor`。文字と同じ色にする |
|
|
32
|
-
| 囲み | 枠や円で囲まない。タップ領域が必要な場合は、ボタン側のサイズを 44px にする |
|
|
33
|
-
| 組 | 1 つの組だけ。混ぜない |
|
|
34
|
-
|
|
35
|
-
## 16 個の対応表
|
|
36
|
-
|
|
37
|
-
| 役 | 名前 | Phosphor(regular) | Tabler(outline) | Lucide |
|
|
38
|
-
| --- | --- | --- | --- | --- |
|
|
39
|
-
| home | ホーム | `house` | `home` | `house` |
|
|
40
|
-
| actor | 人 | `user` | `user` | `user` |
|
|
41
|
-
| idea | ひらめき | `lightbulb` | `bulb` | `lightbulb` |
|
|
42
|
-
| chats | 会話のまとまり | `chats` | `messages` | `messages-square` |
|
|
43
|
-
| pull-request | 変更の取り込み依頼 | `git-pull-request` | `git-pull-request` | `git-pull-request` |
|
|
44
|
-
| approve | 承認 | `check` | `check` | `check` |
|
|
45
|
-
| reject | 却下 | `x` | `x` | `x` |
|
|
46
|
-
| comment | コメント | `chat-text` | `message` | `message-square` |
|
|
47
|
-
| send | 送る | `paper-plane-tilt` | `send` | `send` |
|
|
48
|
-
| stop | 止める | `stop` | `player-stop` | `square` |
|
|
49
|
-
| resume | 再開 | `play` | `player-play` | `play` |
|
|
50
|
-
| warning | 警告 | `warning` | `alert-triangle` | `triangle-alert` |
|
|
51
|
-
| error | 失敗 | `x-circle` | `circle-x` | `circle-x` |
|
|
52
|
-
| settings | 設定 | `gear` | `settings` | `settings` |
|
|
53
|
-
| external | 外へのリンク | `arrow-square-out` | `external-link` | `external-link` |
|
|
54
|
-
| refresh | 更新 | `arrow-clockwise` | `refresh` | `refresh-cw` |
|
|
55
|
-
|
|
56
|
-
人と、人でない相手を見分ける印は、アイコンでなく名前の文字で出す。`error`(失敗)は状態を示すマークで、`reject`(却下)は操作。
|
|
57
|
-
|
|
58
|
-
## 全アイコン(1c)
|
|
59
|
-
|
|
60
|
-
`icons.json` に 133 個(Phosphor 131、自作 2)。用途ごとに分ける(方向と移動、操作、状態と通知、もの、会話、開発、データ、日付、文字、メディア)。各行は名前、Phosphor の名前、日本語の説明。アプリごとの区分は持たない。一覧は `apps/docs` の Icons ページにある(名前で絞り込める)。
|
|
61
|
-
|
|
62
|
-
| 決まり | 中身 |
|
|
63
|
-
| --- | --- |
|
|
64
|
-
| 名前 | 用途の名前(`chevron-right`、`clock-clockwise`)。Phosphor の名前とは別。同じ Phosphor を別の役で使ってよい(`approve` と `check`) |
|
|
65
|
-
| 足し方 | `icons.json` に 1 行足して `pnpm --filter knowidea-icons build`。Phosphor に無いときだけ `custom/<名前>.svg` を描く |
|
|
66
|
-
| 使う側での差し替え | 使う側は、必要な名前のコンポーネントを選んで使う。形を変えたいときは、`icons.json` に自作を足し、同じ名前でオーバーライドする |
|
|
67
|
-
|
|
68
|
-
### 自作(2 個)
|
|
9
|
+
```sh
|
|
10
|
+
npm install knowidea-icons
|
|
11
|
+
```
|
|
69
12
|
|
|
70
|
-
|
|
71
|
-
| --- | --- | --- |
|
|
72
|
-
| `hex-lines` | 六角形に 2 本の線 | 使用量の単位などに使う。Phosphor の `coins` は金銭に読めてしまい、費用(`cost`)と区別できない |
|
|
73
|
-
| `chat-prompt` | 吹き出しにプロンプト | 吹き出しに `>_`。`chats` は人の会話、`terminal-window` は端末で、頼んだ 1 回の作業とは違う |
|
|
13
|
+
## 使う
|
|
74
14
|
|
|
75
|
-
|
|
15
|
+
React では、名前ごとの部品として使う。
|
|
76
16
|
|
|
77
|
-
|
|
17
|
+
```tsx
|
|
18
|
+
import { SearchIcon } from "knowidea-icons/react";
|
|
78
19
|
|
|
79
|
-
|
|
20
|
+
<SearchIcon />
|
|
21
|
+
```
|
|
80
22
|
|
|
81
|
-
|
|
82
|
-
| --- | --- |
|
|
83
|
-
| `dist/svg/<名前>.svg`、`<名前>-bold.svg` | 1 枚ずつ。`currentColor` |
|
|
84
|
-
| `dist/sprite.svg` | 素の HTML。`<svg width="20" height="20"><use href="/sprite.svg#play"/></svg>`。bold は `#play-bold` |
|
|
85
|
-
| `dist/react/` | React 19 用。`<Icon name="chevron-right" size={20} weight="regular" />` と、名前ごとのコンポーネント(`ChevronRightIcon`)。型定義つき(`IconName`) |
|
|
86
|
-
| `dist/icons-data.json` | docs とサンプルが読み込む |
|
|
87
|
-
| `dist/LICENSE-phosphor.txt`、`dist/NOTICE.txt` | ライセンス |
|
|
23
|
+
素の HTML では、`node_modules/knowidea-icons/dist/sprite.svg` をページの近くに写し、`<use>` で指す。
|
|
88
24
|
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
<Icon name="search" /> // 20px、regular、装飾(読み上げない)
|
|
92
|
-
<SearchIcon size={16} weight="bold" title="検索" /> // 16px は bold。title があれば読み上げる
|
|
25
|
+
```html
|
|
26
|
+
<svg class="ki-icon" aria-hidden="true"><use href="sprite.svg#search"></use></svg>
|
|
93
27
|
```
|
|
94
28
|
|
|
95
|
-
|
|
29
|
+
名前の一覧はドキュメントの Icons にある。
|
|
96
30
|
|
|
97
|
-
##
|
|
31
|
+
## 4 つのパッケージ
|
|
98
32
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
33
|
+
| パッケージ | 中身 |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| [knowidea-tokens](https://www.npmjs.com/package/knowidea-tokens) | 色、余白、角丸、書体の CSS 変数と、テーマを作る `createTheme` |
|
|
36
|
+
| [knowidea-css](https://www.npmjs.com/package/knowidea-css) | 部品の見た目(`ki-` のクラス)。素の HTML でも使える |
|
|
37
|
+
| [knowidea-icons](https://www.npmjs.com/package/knowidea-icons) | アイコン 133 個(SVG のスプライトと React) |
|
|
38
|
+
| [knowidea-ui](https://www.npmjs.com/package/knowidea-ui) | React 19 の部品 56 個。土台は Base UI |
|
|
102
39
|
|
|
103
|
-
|
|
40
|
+
Phosphor Icons(MIT)を元にしている。ライセンスは `dist/LICENSE-phosphor.txt`。
|