@iconode/react 2.6.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.
- package/LICENSE +11 -0
- package/README.md +172 -0
- package/dist/index.cjs +10300 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +48 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +10290 -0
- package/dist/index.js.map +1 -0
- package/package.json +149 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Socheath License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Socheath
|
|
4
|
+
|
|
5
|
+
Permission is granted to use, copy, modify, and distribute this software under the following terms:
|
|
6
|
+
1. You may use this software for personal, educational, or commercial purposes.
|
|
7
|
+
2. You may not use this software for any illegal or unethical activities.
|
|
8
|
+
3. You must include this license in any copies or substantial portions of the software.
|
|
9
|
+
4. The software is provided "as is", without warranty of any kind, express or implied.
|
|
10
|
+
5. In no event shall the authors be liable for any claim, damages, or other liability arising from, out of, or in connection with the software or the use or other dealings in the software.
|
|
11
|
+
For more information, please contact:
|
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# iconode
|
|
2
|
+
|
|
3
|
+
A modern, developer‑friendly, colorful SVG icon library and website.
|
|
4
|
+
|
|
5
|
+
- React + TypeScript + Vite
|
|
6
|
+
- TailwindCSS with class‑based light/dark
|
|
7
|
+
- Framer Motion animations
|
|
8
|
+
- Accessible (ARIA labels, keyboard navigation)
|
|
9
|
+
|
|
10
|
+
Live app (dev): `/` homepage, `/docs` documentation.
|
|
11
|
+
|
|
12
|
+
## Repository structure
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
src/ # Icon component library (npm package source)
|
|
16
|
+
categories/ # Icon SVG data by category
|
|
17
|
+
createIcon.tsx # Icon component factory
|
|
18
|
+
types.ts # TypeScript types
|
|
19
|
+
index.ts # Package entry point
|
|
20
|
+
client/ # Docs website (SPA) built with Vite + React Router
|
|
21
|
+
public/ # Static assets for the website
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Requirements
|
|
25
|
+
|
|
26
|
+
- Node.js >= 18
|
|
27
|
+
- pnpm (preferred)
|
|
28
|
+
|
|
29
|
+
## Install & run
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm install
|
|
33
|
+
pnpm dev # Dev server (Vite)
|
|
34
|
+
# open http://localhost:8080
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Build & publish the npm package
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm version patch # Increment version in package.json
|
|
41
|
+
pnpm build # Builds the icon library with tsup
|
|
42
|
+
npm publish --access public
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Build the docs website:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pnpm build:site # Builds SPA to dist/spa
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Using the icon package
|
|
52
|
+
|
|
53
|
+
Once published to npm as `@iconode/react`:
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { Icon } from '@iconode/react';
|
|
57
|
+
|
|
58
|
+
export default function Example() {
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
<Icon name='AdobePhotoshop' size={24} aria-label='Adobe Photoshop' />
|
|
62
|
+
<Icon name='VSCode' size={48} className='align-middle' />
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Props supported by every icon component:
|
|
69
|
+
|
|
70
|
+
- `size?: number` (pixels; default 24)
|
|
71
|
+
- `className?: string`
|
|
72
|
+
- `style?: React.CSSProperties`
|
|
73
|
+
- `aria-label?: string`
|
|
74
|
+
- `onClick?: (e: React.MouseEvent) => void`
|
|
75
|
+
|
|
76
|
+
## SEO Implementation
|
|
77
|
+
|
|
78
|
+
The project includes a pre-configured SEO setup using `react-helmet-async`. To add SEO to your pages:
|
|
79
|
+
|
|
80
|
+
1. Import the SEO component:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { SEO } from '@/components/SEO';
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
2. Use it in your pages with custom metadata:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
function YourPage() {
|
|
90
|
+
return (
|
|
91
|
+
<>
|
|
92
|
+
<SEO
|
|
93
|
+
title='Your Page Title'
|
|
94
|
+
description='Your page description for search engines'
|
|
95
|
+
image='/path-to-social-image.png' // Optional: Social media preview image
|
|
96
|
+
canonical='https://your-site/path' // Optional: Canonical URL
|
|
97
|
+
type='website' // Optional: og:type (default: website)
|
|
98
|
+
/>
|
|
99
|
+
{/* Your page content */}
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
3. Default SEO values are pre-configured for:
|
|
106
|
+
|
|
107
|
+
- Base title suffix: "| Iconode"
|
|
108
|
+
- Default description
|
|
109
|
+
- Open Graph metadata
|
|
110
|
+
- Twitter Cards
|
|
111
|
+
- Basic PWA metadata
|
|
112
|
+
|
|
113
|
+
The SEO component automatically handles:
|
|
114
|
+
|
|
115
|
+
- Title formatting
|
|
116
|
+
- Meta descriptions
|
|
117
|
+
- Open Graph tags
|
|
118
|
+
- Twitter Card metadata
|
|
119
|
+
- Canonical URLs
|
|
120
|
+
- Mobile viewport settings
|
|
121
|
+
- Theme color
|
|
122
|
+
|
|
123
|
+
## Library authoring
|
|
124
|
+
|
|
125
|
+
Icons are defined by category files under:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
src/categories/
|
|
129
|
+
AI.ts
|
|
130
|
+
Apps.ts
|
|
131
|
+
DesignTools.ts
|
|
132
|
+
Frameworks.ts
|
|
133
|
+
Other.ts
|
|
134
|
+
Programming.ts
|
|
135
|
+
Tools.ts
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Each file exports `const iconsData: IconData[]`, where an `IconData` is:
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
interface IconData {
|
|
142
|
+
name: string;
|
|
143
|
+
category: string;
|
|
144
|
+
keywords: string[];
|
|
145
|
+
svgContent: string; // raw <svg>…</svg> with original brand colors/gradients
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The component factory lives at `src/createIcon.tsx` and safely renders colorful SVG using `dangerouslySetInnerHTML` with width/height normalization.
|
|
150
|
+
|
|
151
|
+
To add an icon:
|
|
152
|
+
|
|
153
|
+
1. Pick a category file (or create a new one) and append a new `IconData` with original brand SVG (no color stripping).
|
|
154
|
+
2. The icon is automatically available — `src/index.ts` auto‑builds components from the data set and re‑exports named icons.
|
|
155
|
+
|
|
156
|
+
## Accessibility
|
|
157
|
+
|
|
158
|
+
- All icons accept `aria-label`; default label equals the icon name.
|
|
159
|
+
- Keyboard: Enter/Space triggers `onClick` handlers.
|
|
160
|
+
|
|
161
|
+
## Deploying the website
|
|
162
|
+
|
|
163
|
+
- Vercel or Render are recommended. Build command: `pnpm build:site`, output directory: `dist/spa`.
|
|
164
|
+
|
|
165
|
+
## Performance notes
|
|
166
|
+
|
|
167
|
+
- Glassmorphism is scoped to cards and shells; avoid full‑page heavy blur when possible.
|
|
168
|
+
- Animations use short durations (≈120ms) and layout transitions are limited for smoother route changes.
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
This project is licensed under the [Socheath License](./LICENSE).
|