blip-tokens 2.0.1 → 2.0.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/README.md CHANGED
@@ -302,7 +302,9 @@ build/
302
302
  └── icons.d.ts # TypeScript type definitions
303
303
  ```
304
304
 
305
- The npm package contains design tokens, icon names and types, and the CDN manifest exported as `blip-tokens/assets/manifest`. Artwork registries and standalone SVGs are not packaged. Consumers of the old `assets_*.json` or illustration JSON catalogs must resolve artwork through the CDN manifest instead.
305
+ The npm package contains design tokens, icon names and types, path-only source registries, and the CDN manifest exported as `blip-tokens/assets/manifest`. The build does not generate the old embedded-SVG `assets_*.json` or illustration JSON catalogs. Consumers of those catalogs must resolve artwork through the CDN manifest instead.
306
+
307
+ Packaging uses `.npmignore` exclusions instead of a per-file `package.json` allowlist, so new token outputs are included automatically. Raw SVGs, raw source artwork, legacy embedded-artwork catalogs, and development files are excluded from npm. The standalone SVGs remain in `build/assets/v1` for CDN upload; packaging does not delete them. Tests inspect a real npm archive to check that tokens and exports remain available without raw or embedded SVG artwork.
306
308
 
307
309
  ---
308
310
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "baseUrl": "https://cdn.blip.ai/blip-tokens/",
5
5
  "assets": {
6
6
  "asset-icon-123-outline": {
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 15 Oct 2026 23:33:20 GMT
3
+ // Generated on Fri, 16 Oct 2026 00:50:05 GMT
4
4
 
5
5
  $color-extended-blue: #1968F0;
6
6
  $color-extended-ocean: #00D3E4;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 15 Oct 2026 23:33:20 GMT
3
+ // Generated on Fri, 16 Oct 2026 00:50:05 GMT
4
4
 
5
5
  $color-dark-brand: #0096fa;
6
6
  $color-dark-primary: #1e6bf1;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 15 Oct 2026 23:33:20 GMT
3
+ // Generated on Fri, 16 Oct 2026 00:50:05 GMT
4
4
 
5
5
  $color-high-contrast-brand: #0096fa;
6
6
  $color-high-contrast-primary: #1e6bf1;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 15 Oct 2026 23:33:20 GMT
3
+ // Generated on Fri, 16 Oct 2026 00:50:05 GMT
4
4
 
5
5
  $color-light-brand: #0096fa;
6
6
  $color-light-primary: #1e6bf1;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Thu, 15 Oct 2026 23:33:20 GMT
3
+ // Generated on Fri, 16 Oct 2026 00:50:05 GMT
4
4
 
5
5
  $color-primary-light: #b3d4ff;
6
6
  $color-primary-main: #3f7de8;
@@ -0,0 +1,166 @@
1
+ # AD-003: Gerar tipos para importação de assets em outros projetos
2
+
3
+ ## Status
4
+
5
+ 🔄 **EM REVISÃO** - Proposto em 27/11/2025
6
+
7
+ ## Objetivo
8
+ Padronizar o consumo de assets exportados por `blip-tokens` usando nomes de ícones extraídos diretamente do sistema de arquivos, garantindo segurança de tipos e sincronização automática dos nomes com os arquivos SVG disponíveis.
9
+
10
+ ## Contexto
11
+ O pacote `blip-tokens` passa a expor arrays e tipos compatíveis com TypeScript para representar os ícones disponíveis nas pastas `assets/icons/outline` e `assets/icons/solid`. Isso evita divergências entre componentes que referenciam ícones e o conjunto real de arquivos SVG.
12
+
13
+ ### Opções de importação
14
+ #### Arrays em tempo de execução
15
+ ```typescript
16
+ import { OutlineIcons, SolidIcons, AllIcons } from 'blip-tokens/icons';
17
+
18
+ // Uso na aplicação
19
+ console.log(OutlineIcons); // ["add", "edit", "delete", ...]
20
+ console.log(SolidIcons); // ["add", "attention", ...]
21
+ console.log(AllIcons); // ["add", "attention", "delete", ...]
22
+ ```
23
+
24
+ #### Tipos TypeScript
25
+ ```typescript
26
+ import type { OutlineIcon, SolidIcon, IconName } from 'blip-tokens/icons';
27
+
28
+ // Nomes de ícones com segurança de tipos
29
+ function renderIcon(name: OutlineIcon) {
30
+ // O TypeScript sugere e valida os nomes automaticamente
31
+ return `<icon name="${name}" />`;
32
+ }
33
+
34
+ renderIcon("add"); // ✅ Válido
35
+ renderIcon("invalid"); // ❌ Erro do TypeScript
36
+ ```
37
+
38
+ #### Funções auxiliares
39
+ ```typescript
40
+ import { isOutlineIcon, isSolidIcon, isValidIcon } from 'blip-tokens/icons';
41
+
42
+ // Validação em tempo de execução
43
+ if (isOutlineIcon("add")) {
44
+ console.log("Este ícone existe no conjunto outline");
45
+ }
46
+
47
+ if (isSolidIcon("attention")) {
48
+ console.log("Este ícone existe no conjunto solid");
49
+ }
50
+
51
+ if (isValidIcon("sparkle-ai")) {
52
+ console.log("Este ícone existe em qualquer conjunto");
53
+ }
54
+ ```
55
+
56
+ ### Contagem de ícones
57
+ - **Outline Icons**: 303
58
+ - **Solid Icons**: 366
59
+ - **Unique Icons**: 587
60
+
61
+ ### Observações
62
+ - Os nomes de ícones são extraídos dos nomes dos arquivos (sem a extensão `.svg`).
63
+ - Ícones em subpastas (como `solid/flags/`) usam apenas o nome do arquivo.
64
+ - Os nomes são ordenados alfabeticamente.
65
+ - Os nomes são normalizados para minúsculas; espaços viram hífen. Todos os demais caracteres presentes no nome do arquivo (incluindo acentos, números e pontuação) são preservados nos nomes exportados, sem remoção ou substituição adicional.
66
+
67
+ ## Benefícios
68
+ - Segurança de tipos: o TypeScript bloqueia nomes inválidos em tempo de compilação.
69
+ - Autocompletar: IDEs sugerem automaticamente os nomes válidos.
70
+ - Sempre sincronizado: os nomes vêm diretamente do sistema de arquivos, sem JSON intermediário.
71
+ - Sem duplicações: o sistema garante nomes únicos graças ao escaneamento da pasta.
72
+ - Validação em runtime: funções auxiliares checam dinamicamente se um nome existe.
73
+ - Bundle otimizado: `AllIcons` é pré-computado durante o build para evitar duplicação (~45% menor).
74
+
75
+ ## Exemplos
76
+ ### Componente React
77
+ ```tsx
78
+ import type { OutlineIcon, SolidIcon } from 'blip-tokens/icons';
79
+
80
+ interface IconProps {
81
+ name: OutlineIcon | SolidIcon;
82
+ variant: 'outline' | 'solid';
83
+ }
84
+
85
+ export function Icon({ name, variant }: IconProps) {
86
+ const iconData = getIconData(name, variant);
87
+ return <img src={iconData} alt={name} />;
88
+ }
89
+
90
+ // Uso com autocomplete
91
+ <Icon name="add" variant="outline" />
92
+ <Icon name="attention" variant="solid" />
93
+ ```
94
+
95
+ ### Seletor dinâmico de ícones
96
+ ```tsx
97
+ import { OutlineIcons, SolidIcons } from 'blip-tokens/icons';
98
+ import type { IconName } from 'blip-tokens/icons';
99
+ import { useState } from 'react';
100
+
101
+ export function IconPicker() {
102
+ const [selected, setSelected] = useState<IconName | null>(null);
103
+
104
+ return (
105
+ <div>
106
+ <h3>Outline Icons ({OutlineIcons.length})</h3>
107
+ <div className="icon-grid">
108
+ {OutlineIcons.map(name => (
109
+ <button key={name} onClick={() => setSelected(name)}>
110
+ {name}
111
+ </button>
112
+ ))}
113
+ </div>
114
+
115
+ <h3>Solid Icons ({SolidIcons.length})</h3>
116
+ <div className="icon-grid">
117
+ {SolidIcons.map(name => (
118
+ <button key={name} onClick={() => setSelected(name)}>
119
+ {name}
120
+ </button>
121
+ ))}
122
+ </div>
123
+
124
+ {selected && <p>Selecionado: {selected}</p>}
125
+ </div>
126
+ );
127
+ }
128
+ ```
129
+
130
+ ### Validação de formulário
131
+ ```typescript
132
+ import { isValidIcon } from 'blip-tokens/icons';
133
+
134
+ function validateIconInput(userInput: string) {
135
+ if (!isValidIcon(userInput)) {
136
+ throw new Error(`"${userInput}" não é um nome de ícone válido`);
137
+ }
138
+ return userInput;
139
+ }
140
+ ```
141
+
142
+ ### Busca e filtragem
143
+ ```typescript
144
+ import { AllIcons } from 'blip-tokens/icons';
145
+
146
+ function searchIcons(query: string) {
147
+ return AllIcons.filter(name =>
148
+ name.toLowerCase().includes(query.toLowerCase())
149
+ );
150
+ }
151
+
152
+ // Busca por todos os ícones de seta
153
+ const arrowIcons = searchIcons('arrow');
154
+ // ["arrow-ball-down", "arrow-ball-left", "arrow-down", ...]
155
+ ```
156
+
157
+ ## Changelog
158
+
159
+ | Data | Versão | Mudança | Autor |
160
+ |------|--------|---------|-------|
161
+ | 2025-11-27 | 1.0 | Decisão inicial e implementação | Dev Team |
162
+
163
+ ---
164
+
165
+ **Última Atualização**: 27 de Novembro de 2025
166
+ **Próxima Revisão**: 27 de Maio de 2026 (6 meses)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blip-tokens",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "build/icons.js",
@@ -15,24 +15,6 @@
15
15
  "./build/scss/*": "./build/scss/*",
16
16
  "./build/css/*": "./build/css/*"
17
17
  },
18
- "files": [
19
- "build/*.js",
20
- "build/*.d.ts",
21
- "build/css",
22
- "build/json/variables.json",
23
- "build/json/colors.json",
24
- "build/json/theme-light.json",
25
- "build/json/theme-dark.json",
26
- "build/json/theme-high-contrast.json",
27
- "build/json/extended-color.json",
28
- "build/scss",
29
- "build/assets/v1/manifest.json",
30
- "properties/assets/variables.json",
31
- "properties/assets/theme-light.json",
32
- "properties/assets/theme-dark.json",
33
- "properties/assets/theme-high-contrast.json",
34
- "properties/assets/extended-color.json"
35
- ],
36
18
  "scripts": {
37
19
  "build": "node config.cjs",
38
20
  "clean": "rm -rf build",
@@ -0,0 +1,11 @@
1
+ {
2
+ "asset": {
3
+ "component": {
4
+ "loading-page": { "value": "assets/components/loading-page.svg" },
5
+ "loading-spinner-extra-small": { "value": "assets/components/load-extra-small.svg" },
6
+ "loading-spinner-small": { "value": "assets/components/load-small.svg" },
7
+ "loading-spinner-standard": { "value": "assets/components/load-standard.svg" },
8
+ "upload-pattern": { "value": "assets/components/upload-pattern.svg" }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "asset": {
3
+ "emoji": {
4
+ "beaming-face": {
5
+ "value": "assets/emojis/BeamingFacewithSmilingEyes.svg"
6
+ },
7
+ "confounded-face": {
8
+ "value": "assets/emojis/ConfoundedFace.svg"
9
+ },
10
+ "crying-face": {
11
+ "value": "assets/emojis/CryingFace.svg"
12
+ },
13
+ "dizzy-face": {
14
+ "value": "assets/emojis/DizzyFace.svg"
15
+ },
16
+ "expressionless-face": {
17
+ "value": "assets/emojis/ExpressionlessFace.svg"
18
+ },
19
+ "face-blowing-a-kiss": {
20
+ "value": "assets/emojis/FaceBlowingaKiss.svg"
21
+ },
22
+ "face-with-mask": {
23
+ "value": "assets/emojis/FacewithMedicalMask.svg"
24
+ },
25
+ "face-with-open-mouth": {
26
+ "value": "assets/emojis/FacewithOpenMouth.svg"
27
+ },
28
+ "face-without-mouth": {
29
+ "value": "assets/emojis/FaceWithoutMouth.svg"
30
+ },
31
+ "face-with-tears-of-joy": {
32
+ "value": "assets/emojis/FacewithTearsofJoy.svg"
33
+ },
34
+ "face-with-tongue": {
35
+ "value": "assets/emojis/FacewithTongue.svg"
36
+ },
37
+ "fearful-face": {
38
+ "value": "assets/emojis/FearfulFace.svg"
39
+ },
40
+ "grinning-face": {
41
+ "value": "assets/emojis/GrinningFace.svg"
42
+ },
43
+ "grinning-face-with-big-eyes": {
44
+ "value": "assets/emojis/GrinningFacewithBigEyes.svg"
45
+ },
46
+ "grinning-face-with-smilling-eyes": {
47
+ "value": "assets/emojis/GrinningFacewithSmilingEyes.svg"
48
+ },
49
+ "grinning-face-with-sweat": {
50
+ "value": "assets/emojis/GrinningFacewithSweat.svg"
51
+ },
52
+ "hushed-face": {
53
+ "value": "assets/emojis/HushedFace.svg"
54
+ },
55
+ "kissing-face-with-smilling-eyes": {
56
+ "value": "assets/emojis/KissingFacewithSmilingEyes.svg"
57
+ },
58
+ "loudly-cring-face": {
59
+ "value": "assets/emojis/LoudlyCryingFace.svg"
60
+ },
61
+ "nerd-face": {
62
+ "value": "assets/emojis/NerdFace.svg"
63
+ },
64
+ "neutral-face": {
65
+ "value": "assets/emojis/NeutralFace.svg"
66
+ },
67
+ "perservering-face": {
68
+ "value": "assets/emojis/PerseveringFace.svg"
69
+ },
70
+ "pouting-face": {
71
+ "value": "assets/emojis/PoutingFace.svg"
72
+ },
73
+ "relieved-face": {
74
+ "value": "assets/emojis/RelievedFace.svg"
75
+ },
76
+ "sleeping-face": {
77
+ "value": "assets/emojis/SleepingFace.svg"
78
+ },
79
+ "slightly-frowning-face": {
80
+ "value": "assets/emojis/SlightlyFrowningFace.svg"
81
+ },
82
+ "slightly-smiling-face": {
83
+ "value": "assets/emojis/SlightlySmilingFace.svg"
84
+ },
85
+ "smiling-face": {
86
+ "value": "assets/emojis/SmilingFace.svg"
87
+ },
88
+ "smiling-face-with-halo": {
89
+ "value": "assets/emojis/SmilingFacewithHalo.svg"
90
+ },
91
+ "smiling-face-with-heart-eyes": {
92
+ "value": "assets/emojis/SmilingFacewithHeartEyes.svg"
93
+ },
94
+ "smiling-face-with-smiling-eyes": {
95
+ "value": "assets/emojis/SmilingFacewithSmilingEyes.svg"
96
+ },
97
+ "smiling-face-with-sunglasses": {
98
+ "value": "assets/emojis/SmilingFacewithSunglasses.svg"
99
+ },
100
+ "smirking-face": {
101
+ "value": "assets/emojis/SmirkingFace.svg"
102
+ },
103
+ "squirting-face-with-tongue": {
104
+ "value": "assets/emojis/SquintingFacewithTongue.svg"
105
+ },
106
+ "winking-face": {
107
+ "value": "assets/emojis/WinkingFace.svg"
108
+ },
109
+ "winking-face-with-tongue": {
110
+ "value": "assets/emojis/WinkingFacewithTongue.svg"
111
+ }
112
+ }
113
+ }
114
+ }