y-icons 0.1.0 → 0.1.1

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 CHANGED
@@ -1,43 +1,20 @@
1
1
  # y-icons
2
2
 
3
- MDI に不足するアイコンを **簡単に作って・簡単に使う** ための独自アイコンパッケージ。
3
+ MDI に不足するアイコンを補う独自アイコンパッケージ。1 つの SVG から
4
+ **Vue/Vuetify・HTML/CSS・Figma** の 3 経路で使える(MDI 互換:24dp グリッド・単一 `<path>`・`currentColor`)。
4
5
 
5
- **1 つの真実の源(`icons/` 配下の SVG)** から、Vue/Vuetify・Web/ERB・Figma の **3 経路すべて** を
6
- 自動生成・配布する。
7
-
8
- ```
9
- icons/<name>.svg ← 真実の源(SoT)。1 枚置くだけ
10
- │ npm run build
11
- ├─ コード(Vuetify) … y: アイコンセット(<v-icon icon="y:name"> など全 icon プロパティ)
12
- ├─ コード(Web/ERB) … アイコンフォント(<i class="yicon yicon-name">)
13
- ├─ Figma … Storybook からコピー&ペースト(グリフ or SVG)
14
- └─ 安定コードポイント(codepoints.json・追記専用)
15
- ```
6
+ [![npm](https://img.shields.io/npm/v/y-icons.svg)](https://www.npmjs.com/package/y-icons)
16
7
 
17
8
  ---
18
9
 
19
- ## クイックスタート
10
+ ## インストール
20
11
 
21
12
  ```bash
22
- npm install
23
- npm run build # build:set + build:font + tsc
24
-
25
- npm run storybook # ギャラリー・候補・利用例・フォントDL を閲覧
13
+ npm install y-icons # または yarn add y-icons
26
14
  ```
27
15
 
28
16
  ---
29
17
 
30
- ## アイコンを追加する
31
-
32
- 1. **作る**:`icons/<name>.svg` を置く。
33
- - デザイナーは Figma で作図 → SVG 書き出し(下記「設計仕様」準拠)。
34
- - 開発者は **`/create-icon <要望>`** スキルで AI 叩き台を 10 案生成 → Storybook `icons/Candidates` で
35
- MDI と見比べて選定 → `icons/` へ昇格。
36
- 2. **ビルド**:`npm run build`(`build:set` が仕様+バウンディングボックスを検証)。
37
- 3. **配布**:CI がフォント/npm を生成・配布(後述)。
38
-
39
- ---
40
-
41
18
  ## 使い方(3 経路)
42
19
 
43
20
  ### 1. Vue / Vuetify
@@ -54,80 +31,53 @@ createVuetify({ icons: vuetifyIcons })
54
31
  <v-btn :icon="'y:inventory-transfer'" />
55
32
  ```
56
33
 
57
- FW 非依存に使う場合:`import { yIconPaths } from 'y-icons'` / 個別 SVG は `y-icons/svg/<name>.svg`。
58
-
59
- ### 2. Web の生 class / Rails ERB(Vuetify を介さない場所)
34
+ 既存の `mdi` セットと共存する(`mdi-*` はそのまま、`y:` が独自アイコン)。
60
35
 
61
- `dist/font/y-icons.css` を読み込み:
36
+ FW 非依存に使う場合:
62
37
 
63
- ```html
64
- <i class="yicon yicon-inventory-transfer"></i> <!-- クラス -->
65
- <span class="yicon">inventory-transfer</span> <!-- 名前リガチャ(ブラウザのみ) -->
38
+ ```ts
39
+ import { yIconPaths, yIconNames } from 'y-icons' // name→d の map / 名前一覧
66
40
  ```
67
41
 
68
- ### 3. Figma(Storybook からコピー&ペースト)
42
+ 個別の生 SVG `y-icons/svg/<name>.svg` から参照できる。
69
43
 
70
- Storybook `icons/CustomIcons` の各アイコンに 2 つのコピーボタン。MDI(pictogrammers) と同じ運用:
44
+ ### 2. プレーン HTML / CSS(アイコンフォント)
71
45
 
72
- | ボタン | コピー内容 | Figma 結果 | フォント要否 |
73
- |---|---|---|---|
74
- | **グリフをコピー** | PUA 文字+`font-family: y-icons` | テキスト(y-icons フォント)= MDI の Copy Glyph と同じ | **要インストール** |
75
- | **SVGをコピー** | `<svg fill="currentColor">` | ベクター図形 | 不要 |
46
+ Vuetify を介さない場所(素の HTML、各種テンプレートエンジン等)では、同梱の
47
+ `y-icons/font/y-icons.css`(フォント実体 `y-icons.woff2` なども `y-icons/font/` に同梱)を読み込み:
76
48
 
77
- フォントは `icons/DownloadFont` ストーリーからダウンロードしてインストール。
78
- 詳細なデザイナー手順は [`docs/figma-guide.md`](docs/figma-guide.md)。
49
+ ```html
50
+ <i class="yicon yicon-inventory-transfer"></i> <!-- クラス -->
51
+ <span class="yicon">inventory-transfer</span> <!-- 名前リガチャ(ブラウザのみ) -->
52
+ ```
79
53
 
80
- > Figma のリガチャ(名前を打つと変換)は信頼性が低いため使わない。リガチャは Web/ERB(ブラウザ)専用。
54
+ ### 3. Figma
81
55
 
82
- ---
56
+ アイコンフォントをインストールして使う(MDI(pictogrammers) と同じ運用):
83
57
 
84
- ## Storybook(運用の入口)
58
+ | 方法 | Figma 結果 | フォント要否 |
59
+ |---|---|---|
60
+ | **グリフを貼り付け** | テキスト(`font-family: y-icons` + PUA 文字)でアイコン表示 | **要インストール** |
61
+ | **SVG を貼り付け** | ベクター図形(`<svg fill="currentColor">`) | 不要 |
85
62
 
86
- | ストーリー | 役割 |
87
- |---|---|
88
- | `icons/CustomIcons` | 一覧 + グリフ/SVG コピー(Figma 貼付) |
89
- | `icons/Candidates` | 候補プレビュー + MDI 参照(採点) |
90
- | `icons/VuetifyUsage` | `y:` が全 Vuetify icon プロパティで効く実証 |
91
- | `icons/DownloadFont` | フォント一式(ttf/woff/css/cheatsheet)を DL |
63
+ フォント実体(`y-icons.ttf` / `.woff` / `.woff2`)とチートシート(`y-icons.html`)は
64
+ パッケージの `y-icons/font/` 配下、または [GitHub Releases](https://github.com/hamayou-61/y-icons/releases) から入手できる。
92
65
 
93
66
  ---
94
67
 
95
- ## 設計仕様(Material Design アイコン規格準拠:24dp グリッド/キーライン)
68
+ ## 設計仕様(参考)
69
+
70
+ 収録アイコンは Material Design アイコン規格(24dp グリッド/キーライン)に準拠:
96
71
 
97
72
  | 項目 | 値 |
98
73
  |---|---|
99
74
  | グリッド | 24×24 dp(viewBox `0 0 24 24` 固定) |
100
75
  | ライブエリア / 余白 | 中身 ~20×20dp(座標 2〜22)、外周 2dp padding |
101
- | ストローク幅 | 2dp(2dp 以下は角を丸めない) |
102
- | 角丸 | 既定 2dp |
103
- | キーラインシェイプ | 円⌀20 / 正方形18 / 縦長16×20 / 横長20×16 |
104
-
105
- 形式:**単一 `<path>`**(`<g>`・`transform`・複数 path 不可)/**`fill` を書かない**(`currentColor`)/
106
- `stroke` 不使用(中空は外形+内形の逆回りサブパス、帯幅 2dp 一貫)/座標 0.5dp 刻み。
107
- `npm run build:set` が SVGO 正規化+仕様+bbox を検証(違反で停止)。
108
-
109
- ---
110
-
111
- ## 成果物とリポ構成
112
-
113
- | パス | 内容 |
114
- |---|---|
115
- | `icons/*.svg` | **SoT**(デザイナーが置く) |
116
- | `candidates/*.svg` | 採用前の候補(`/create-icon` が書き込む下書き) |
117
- | `src/registry.generated.ts` | 自動生成(name→d) |
118
- | `src/vuetify.ts` | Vuetify アダプタ(`vuetifyIcons` / `yIconSet`) |
119
- | `scripts/build-set.mjs` / `build-font.mjs` | 生成(registry/svg ・ フォント) |
120
- | `dist/` | 配布物(gitignore。CI/publish 時に生成) |
121
- | `codepoints.json` | 名前→コードポイントの固定割当(**コミット対象・追記専用**) |
122
-
123
- `package.json` の exports:`.`(FW 非依存)/`./vuetify`/`./font/*`/`./svg/*`。
76
+ | ストローク幅 | 2dp(中空は外形+内形の逆回りサブパスで表現) |
77
+ | 形式 | 単一 `<path>` / `fill` を書かない(`currentColor`) |
124
78
 
125
79
  ---
126
80
 
127
- ## CI
128
-
129
- - **push / PR**(`.github/workflows/ci.yml`):`npm run build` + **生成物ドリフト検査** +
130
- **アイコンフォントを成果物としてアップロード**(各実行からダウンロード可)。
131
- - **Release 公開**(`.github/workflows/release.yml`):`y-icons` を publish + フォントを Releases に添付。
81
+ ## ライセンス
132
82
 
133
- 稼働前 TODO:registry 確定(GitHub Packages 等)、`package.json` の `private` 解除+`publishConfig` 設定。
83
+ [MIT](LICENSE)
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "y-icons",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "独自アイコン(MDI互換)。単一の真実の源(icons/ 配下のSVG群)から、Vue/Vuetify用アイコンセット・生SVG/d-map・Figma用アイコンフォントを生成・配布する。",
5
5
  "type": "module",
6
6
  "license": "MIT",