@ds-mo/icons 4.3.0 → 4.4.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 +32 -0
- package/dist/meta.json +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -100,6 +100,37 @@ Drop the sprite into your HTML and reference by kebab-case name:
|
|
|
100
100
|
|
|
101
101
|
Sprite path: `node_modules/@ds-mo/icons/dist/sprite.svg` (or via the `./sprite` subpath export).
|
|
102
102
|
|
|
103
|
+
### iOS / Xcode asset catalog
|
|
104
|
+
|
|
105
|
+
Generate a flat folder of vector PDFs — one per icon — for use in Xcode asset catalogs:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm run build # required first — generates dist/
|
|
109
|
+
npm run build:pdf # outputs dist/pdf/<Name>.pdf (428 files)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Adding to Xcode:**
|
|
113
|
+
|
|
114
|
+
1. Drag `dist/pdf/` into your `.xcassets` asset catalog in Xcode.
|
|
115
|
+
2. For each icon, set **Scales → Single Scale** in the Attributes inspector — iOS scales the vector at runtime.
|
|
116
|
+
3. For **system icons** (monochrome, e.g. `ArrowRight.pdf`): set **Render As → Template Image** so the icon responds to tint color.
|
|
117
|
+
4. For **flag icons** (e.g. `FlagFrance.pdf`): set **Render As → Original Image** to preserve their colors.
|
|
118
|
+
|
|
119
|
+
Then use in SwiftUI or UIKit:
|
|
120
|
+
|
|
121
|
+
```swift
|
|
122
|
+
// SwiftUI
|
|
123
|
+
Image("ArrowRight")
|
|
124
|
+
.renderingMode(.template)
|
|
125
|
+
.foregroundColor(.accentColor)
|
|
126
|
+
|
|
127
|
+
Image("FlagFrance")
|
|
128
|
+
.renderingMode(.original)
|
|
129
|
+
|
|
130
|
+
// UIKit
|
|
131
|
+
UIImage(named: "ArrowRight")?.withRenderingMode(.alwaysTemplate)
|
|
132
|
+
```
|
|
133
|
+
|
|
103
134
|
### Metadata manifest
|
|
104
135
|
|
|
105
136
|
Machine-readable icon list (for docs, agents, search indexes):
|
|
@@ -175,6 +206,7 @@ Add a config entry to `scripts/utils/categories.mjs` with its own `dir`, `prefix
|
|
|
175
206
|
```bash
|
|
176
207
|
npm run build # full build (React + sprite + SVG strings + meta)
|
|
177
208
|
npm run build:docs # regenerate docs/index.html
|
|
209
|
+
npm run build:pdf # iOS PDF export → dist/pdf/ (run after build)
|
|
178
210
|
npm run dev # watch mode
|
|
179
211
|
```
|
|
180
212
|
|
package/dist/meta.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ds-mo/icons",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "IcoMo — 426 SVG icons (394 system icons + 32 country flags) as tree-shakeable React components, framework-agnostic SVG strings, TypeScript definitions, and SVG sprite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"icons",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"types": "./dist/svg/*.d.ts"
|
|
61
61
|
},
|
|
62
62
|
"./sprite": "./dist/sprite.svg",
|
|
63
|
+
"./pdf/*": "./dist/pdf/*.pdf",
|
|
63
64
|
"./meta": {
|
|
64
65
|
"import": "./dist/meta.mjs",
|
|
65
66
|
"types": "./dist/meta.d.ts",
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
"scripts": {
|
|
82
83
|
"build": "node scripts/build.mjs",
|
|
83
84
|
"build:docs": "node scripts/build-docs.mjs",
|
|
85
|
+
"build:pdf": "node scripts/generate-pdfs.mjs",
|
|
84
86
|
"dev": "node scripts/build.mjs --watch",
|
|
85
87
|
"clean": "rm -rf dist"
|
|
86
88
|
},
|
|
@@ -88,7 +90,9 @@
|
|
|
88
90
|
"react": ">=17.0.0"
|
|
89
91
|
},
|
|
90
92
|
"devDependencies": {
|
|
91
|
-
"chokidar": "^5.0.0"
|
|
93
|
+
"chokidar": "^5.0.0",
|
|
94
|
+
"pdfkit": "^0.18.0",
|
|
95
|
+
"svg-to-pdfkit": "^0.1.8"
|
|
92
96
|
},
|
|
93
97
|
"engines": {
|
|
94
98
|
"node": ">=20.19.0"
|