@promptui-lib/core 0.1.16 → 0.1.17
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 +31 -0
- package/dist/tokens/typography.d.ts +2 -1
- package/dist/tokens/typography.d.ts.map +1 -1
- package/dist/tokens/typography.js +20 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -180,6 +180,37 @@ export FIGMA_FILE_ID=ABC123xyz
|
|
|
180
180
|
**File ID:**
|
|
181
181
|
Da URL do Figma: `https://www.figma.com/file/ABC123xyz/MeuProjeto` → `ABC123xyz`
|
|
182
182
|
|
|
183
|
+
### Entendendo o fileId vs node-id
|
|
184
|
+
|
|
185
|
+
> ⚠️ **Importante**: O `fileId` é do **arquivo Figma inteiro**, não de uma tela específica!
|
|
186
|
+
|
|
187
|
+
Na URL do Figma:
|
|
188
|
+
```
|
|
189
|
+
https://www.figma.com/design/5gCjy5F30XJySmOPpgDKLM/Tela-de-Login?node-id=13-2&m=dev
|
|
190
|
+
└──────────────────────┘ └──────┘
|
|
191
|
+
fileId node-id (NÃO usar)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
| Conceito | O que é | Precisa na config? |
|
|
195
|
+
|----------|---------|-------------------|
|
|
196
|
+
| `fileId` | Identifica o **arquivo Figma inteiro** | ✅ Sim |
|
|
197
|
+
| `node-id` | Identifica um frame específico | ❌ Não |
|
|
198
|
+
|
|
199
|
+
**Regra:**
|
|
200
|
+
- **Mesmo arquivo Figma, telas diferentes** → Use o **mesmo fileId**
|
|
201
|
+
- **Arquivo Figma diferente** → Precisa de um **novo fileId**
|
|
202
|
+
|
|
203
|
+
**Exemplo:**
|
|
204
|
+
```
|
|
205
|
+
📁 Meu Projeto (fileId: ABC123xyz)
|
|
206
|
+
├── #LoginScreen ← mesmo fileId
|
|
207
|
+
├── #HomeScreen ← mesmo fileId
|
|
208
|
+
├── #ProfileScreen ← mesmo fileId
|
|
209
|
+
└── #SettingsScreen ← mesmo fileId
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
O CLI busca automaticamente **todos os frames** que começam com `#` dentro do arquivo.
|
|
213
|
+
|
|
183
214
|
---
|
|
184
215
|
|
|
185
216
|
## Guia para Designers
|
|
@@ -31,7 +31,8 @@ export declare function findFontWeightToken(weight: number, customTokens?: Recor
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function findLineHeightToken(value: number): string;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Gera valor de font-family com fallbacks apropriados
|
|
35
|
+
* Não usa tokens - cada design tem suas próprias fontes
|
|
35
36
|
*/
|
|
36
37
|
export declare function findFontFamilyToken(fontFamily: string): string;
|
|
37
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/tokens/typography.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,wBAAwB,EAAE,cAAc,EASpD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,EAMxD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,EAIxD,CAAC;
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/tokens/typography.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,wBAAwB,EAAE,cAAc,EASpD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,EAMxD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,EAIxD,CAAC;AAIF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAC;AAErE;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmBzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAuB9D;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB"}
|
|
@@ -24,12 +24,9 @@ export const DEFAULT_LINE_HEIGHT_TOKENS = [
|
|
|
24
24
|
{ value: 1.5, token: '$line-height-normal' },
|
|
25
25
|
{ value: 1.75, token: '$line-height-relaxed' },
|
|
26
26
|
];
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'Roboto': '$font-family-body',
|
|
31
|
-
'SF Pro': '$font-family-body',
|
|
32
|
-
};
|
|
27
|
+
// Não usamos tokens para font-family - cada design usa fontes diferentes
|
|
28
|
+
// O gerador usa o nome da fonte diretamente com fallback para system fonts
|
|
29
|
+
export const DEFAULT_FONT_FAMILY_TOKENS = {};
|
|
33
30
|
/**
|
|
34
31
|
* Encontra token de font-size
|
|
35
32
|
*/
|
|
@@ -71,13 +68,27 @@ export function findLineHeightToken(value) {
|
|
|
71
68
|
return match.token;
|
|
72
69
|
}
|
|
73
70
|
/**
|
|
74
|
-
*
|
|
71
|
+
* Gera valor de font-family com fallbacks apropriados
|
|
72
|
+
* Não usa tokens - cada design tem suas próprias fontes
|
|
75
73
|
*/
|
|
76
74
|
export function findFontFamilyToken(fontFamily) {
|
|
77
75
|
// Normaliza o nome da fonte
|
|
78
76
|
const normalized = fontFamily.split(',')[0].trim().replace(/["']/g, '');
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
// Se já tem fallbacks, retorna como está
|
|
78
|
+
if (fontFamily.includes(',')) {
|
|
79
|
+
return fontFamily;
|
|
80
|
+
}
|
|
81
|
+
// Adiciona fallbacks padrão baseado no tipo de fonte
|
|
82
|
+
const monoFonts = ['Fira Code', 'Monaco', 'Consolas', 'Courier New', 'monospace'];
|
|
83
|
+
const serifFonts = ['Georgia', 'Times New Roman', 'Times', 'serif', 'Playfair Display', 'Merriweather'];
|
|
84
|
+
if (monoFonts.some(f => normalized.toLowerCase().includes(f.toLowerCase()))) {
|
|
85
|
+
return `"${normalized}", "Consolas", monospace`;
|
|
86
|
+
}
|
|
87
|
+
if (serifFonts.some(f => normalized.toLowerCase().includes(f.toLowerCase()))) {
|
|
88
|
+
return `"${normalized}", Georgia, serif`;
|
|
89
|
+
}
|
|
90
|
+
// Sans-serif (padrão)
|
|
91
|
+
return `"${normalized}", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`;
|
|
81
92
|
}
|
|
82
93
|
/**
|
|
83
94
|
* Gera propriedades de tipografia completas
|