balzer-icon 0.15.0 → 0.16.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cesar Balzer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,9 +1,296 @@
1
- ### Adicionar os icones depois de colocados na pasta lib
1
+ # Balzer Icon
2
2
 
3
- yarn names
3
+ ![npm](https://img.shields.io/npm/v/balzer-icon)
4
+ ![npm downloads](https://img.shields.io/npm/dm/balzer-icon)
5
+ ![build](https://img.shields.io/github/actions/workflow/status/CesarBalzer/balzer-icon/release.yml)
6
+ ![license](https://img.shields.io/npm/l/balzer-icon)
4
7
 
5
- ### Padrao de commit
8
+ Biblioteca oficial de ícones React do ecossistema Balzer.
6
9
 
7
- feat: Mensagem
8
- fix: Mensagem
9
-
10
+ Compatível com React 18+, SVG otimizado, tree-shakable, build em ESModule e UMD, com documentação automática via GitHub Pages.
11
+
12
+ Homepage:
13
+ https://cesarbalzer.github.io/balzer-icon/
14
+
15
+ Package NPM:
16
+ https://www.npmjs.com/package/balzer-icon/
17
+
18
+ ---
19
+
20
+ # Instalação
21
+
22
+ ```bash
23
+ yarn add balzer-icon
24
+ ```
25
+
26
+ ou
27
+
28
+ ```bash
29
+ npm install balzer-icon
30
+ ```
31
+
32
+ ---
33
+
34
+ # Uso
35
+
36
+ ```tsx
37
+ import { Icon } from 'balzer-icon';
38
+
39
+ export default function Example() {
40
+ return (
41
+ <Icon name="home" size={24} color="#000" />
42
+ );
43
+ }
44
+ ```
45
+
46
+ ---
47
+
48
+ # Estrutura do projeto
49
+
50
+ ```
51
+ balzer-icon/
52
+ ├── lib/ # Componentes principais
53
+ │ └── Icon.tsx
54
+ ├── public/
55
+ │ └── icons/ # SVGs base
56
+ ├── utils/
57
+ │ └── generateNames # Script de geração automática
58
+ ├── docs/ # Documentação (GitHub Pages)
59
+ ├── dist/ # Build publicado no npm
60
+ ├── vite.config.ts
61
+ ├── vite.config.docs.ts
62
+ ├── package.json
63
+ ```
64
+
65
+ ---
66
+
67
+ # Como adicionar um novo ícone
68
+
69
+ ## 1. Adicionar o SVG
70
+
71
+ Coloque o arquivo em:
72
+
73
+ ```
74
+ public/icons/
75
+ ```
76
+
77
+ Exemplo:
78
+
79
+ ```
80
+ public/icons/user.svg
81
+ ```
82
+
83
+ ---
84
+
85
+ ## 2. Gerar o mapeamento
86
+
87
+ ```bash
88
+ yarn names
89
+ ```
90
+
91
+ Esse comando atualiza automaticamente a lista de ícones.
92
+
93
+ ---
94
+
95
+ ## 3. Testar localmente
96
+
97
+ ```bash
98
+ yarn dev
99
+ ```
100
+
101
+ Ou visualizar docs:
102
+
103
+ ```bash
104
+ yarn preview:docs
105
+ ```
106
+
107
+ ---
108
+
109
+ # Build
110
+
111
+ Build da biblioteca:
112
+
113
+ ```bash
114
+ yarn build
115
+ ```
116
+
117
+ Output:
118
+
119
+ ```
120
+ dist/
121
+ ```
122
+
123
+ Build da documentação:
124
+
125
+ ```bash
126
+ yarn build:docs
127
+ ```
128
+
129
+ Output:
130
+
131
+ ```
132
+ docs/
133
+ ```
134
+
135
+ ---
136
+
137
+ # Deploy
138
+
139
+ Deploy automático ocorre em:
140
+
141
+ - push na branch main
142
+ - criação de release
143
+ - execução manual do workflow
144
+
145
+ ---
146
+
147
+ # Versionamento
148
+
149
+ Este projeto usa Conventional Commits.
150
+
151
+ ## feat
152
+
153
+ Nova funcionalidade
154
+
155
+ ```bash
156
+ git commit -m "feat: add new icons"
157
+ ```
158
+
159
+ ## fix
160
+
161
+ Correção
162
+
163
+ ```bash
164
+ git commit -m "fix: correct icon rendering"
165
+ ```
166
+
167
+ ## chore
168
+
169
+ Manutenção
170
+
171
+ ```bash
172
+ git commit -m "chore: update dependencies"
173
+ ```
174
+
175
+ ## docs
176
+
177
+ Documentação
178
+
179
+ ```bash
180
+ git commit -m "docs: update readme"
181
+ ```
182
+
183
+ ## refactor
184
+
185
+ Refatoração
186
+
187
+ ```bash
188
+ git commit -m "refactor: improve icon loader"
189
+ ```
190
+
191
+ ## breaking change
192
+
193
+ ```bash
194
+ git commit -m "feat!: change icon API"
195
+ ```
196
+
197
+ ---
198
+
199
+ # Fluxo completo
200
+
201
+ ```bash
202
+ # adicionar ícone
203
+ public/icons/new-icon.svg
204
+
205
+ # gerar nomes
206
+ yarn names
207
+
208
+ # testar
209
+ yarn dev
210
+
211
+ # commit
212
+ git add .
213
+ git commit -m "feat: add new icon"
214
+
215
+ # push
216
+ git push origin main
217
+ ```
218
+
219
+ ---
220
+
221
+ # Desenvolvimento local
222
+
223
+ ```bash
224
+ yarn install
225
+ yarn dev
226
+ ```
227
+
228
+ ---
229
+
230
+ # Arquitetura interna
231
+
232
+ A biblioteca é construída usando:
233
+
234
+ - Vite (build tool)
235
+ - TypeScript
236
+ - Rollup (via Vite)
237
+ - SVG como fonte primária
238
+ - geração automática de tipos
239
+ - output em ESModule e UMD
240
+
241
+ Fluxo interno:
242
+
243
+ ```
244
+ SVG → generateNames → Icon component → Vite build → dist → npm publish
245
+ ```
246
+
247
+ React é definido como peerDependency para evitar duplicação.
248
+
249
+ ---
250
+
251
+ # Contribuição
252
+
253
+ Passos:
254
+
255
+ ```bash
256
+ git clone https://github.com/CesarBalzer/balzer-icon
257
+ cd balzer-icon
258
+
259
+ yarn install
260
+ ```
261
+
262
+ Criar branch:
263
+
264
+ ```bash
265
+ git checkout -b feat/new-icons
266
+ ```
267
+
268
+ Adicionar ícones e gerar nomes:
269
+
270
+ ```bash
271
+ yarn names
272
+ ```
273
+
274
+ Commit:
275
+
276
+ ```bash
277
+ git commit -m "feat: add new icons"
278
+ ```
279
+
280
+ Push:
281
+
282
+ ```bash
283
+ git push origin feat/new-icons
284
+ ```
285
+
286
+ Criar Pull Request.
287
+
288
+ ---
289
+
290
+ # Licença
291
+
292
+ MIT
293
+
294
+ ---
295
+
296
+ Autor: Cesar Balzer
package/dist/Icon.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { default as icons } from './svg';
2
+
3
+ export type IconName = keyof typeof icons;
4
+ export interface IconProps extends React.SVGProps<SVGSVGElement> {
5
+ name: IconName;
6
+ size?: number | string;
7
+ }
8
+ declare const Icon: React.FC<IconProps>;
9
+ export default Icon;
@@ -0,0 +1,5 @@
1
+ import { default as Icon } from './Icon';
2
+
3
+ export default Icon;
4
+ export * from './Icon';
5
+ export * from './svg';