@yberagroup/kaizen-ui 0.0.2 → 0.0.4
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 +92 -12
- package/bin/kaizen-ui.mjs +311 -0
- package/dist/components/title.d.ts +15 -0
- package/dist/components/title.d.ts.map +1 -0
- package/dist/components/title.js +29 -0
- package/dist/components/title.js.map +1 -0
- package/dist/lib/icons.d.ts +9 -0
- package/dist/lib/icons.d.ts.map +1 -0
- package/dist/lib/icons.js +9 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +34 -16
- package/postcss.config.mjs +4 -1
- package/src/styles/globals.base.css +33 -0
- package/src/styles/globals.css +2 -36
- package/src/styles/globals.esc.css +2 -0
- package/src/styles/globals.group.css +2 -0
- package/tailwind-preset.cjs +96 -0
- package/eslint.config.js +0 -4
- package/src/components/.gitkeep +0 -0
- package/src/components/title.tsx +0 -54
- package/src/hooks/.gitkeep +0 -0
- package/src/lib/icons.ts +0 -48
- package/src/lib/utils.ts +0 -6
- package/tsconfig.json +0 -11
- package/tsconfig.lint.json +0 -8
package/README.md
CHANGED
|
@@ -1,21 +1,101 @@
|
|
|
1
1
|
# @yberagroup/kaizen-ui
|
|
2
2
|
|
|
3
|
-
Componentes React do Kaizen Design System
|
|
4
|
-
Depende de `@yberagroup/kaizen-tokens` para temas e variáveis CSS.
|
|
3
|
+
Componentes React do Kaizen Design System com Tailwind CSS v3.
|
|
5
4
|
|
|
6
|
-
##
|
|
5
|
+
## Requisitos no projeto consumidor
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
- Tailwind CSS `^3.4`
|
|
8
|
+
- PostCSS + Autoprefixer
|
|
9
|
+
- `@yberagroup/kaizen-tokens` instalado (dependencia ja declarada na UI)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
## Instalacao
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- Linux/macOS: `export FONTAWESOME_PRO_TOKEN=seu-token`
|
|
13
|
+
```bash
|
|
14
|
+
npm i @yberagroup/kaizen-ui @yberagroup/kaizen-tokens
|
|
15
|
+
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## Setup via wizard
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
```bash
|
|
20
|
+
npx @yberagroup/kaizen-ui init
|
|
21
|
+
```
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
O comando cria/atualiza:
|
|
24
|
+
- `tailwind.config.cjs` com preset Kaizen
|
|
25
|
+
- `postcss.config.cjs` com Tailwind + Autoprefixer
|
|
26
|
+
- se existirem `tailwind.config.js`, `tailwind.config.mjs`, `postcss.config.js` ou `postcss.config.mjs` (ex.: template Vite), eles sao **removidos** para nao competir com os `.cjs`
|
|
27
|
+
- import do tema no arquivo de entrada (`src/main.tsx`, `src/index.tsx`, `app/layout.tsx`, etc.) **ou**, no modo migracao, no seu CSS global
|
|
28
|
+
|
|
29
|
+
Temas suportados no wizard:
|
|
30
|
+
- `esc` — `@yberagroup/kaizen-ui/globals/esc.css`
|
|
31
|
+
- `group` — `@yberagroup/kaizen-ui/globals/group.css`
|
|
32
|
+
|
|
33
|
+
### CSS global ja existente (semi-automatico)
|
|
34
|
+
|
|
35
|
+
Se o wizard encontrar alguma destas folhas (quando existirem no disco), ele pergunta como integrar:
|
|
36
|
+
|
|
37
|
+
- `src/index.css`
|
|
38
|
+
- `src/globals.css`, `src/global.css`
|
|
39
|
+
- `src/styles/globals.css`, `src/styles/index.css`
|
|
40
|
+
- `app/globals.css`
|
|
41
|
+
- `styles/globals.css`
|
|
42
|
+
|
|
43
|
+
**Opcao 1 — Manter locais:** o tema Kaizen e importado no **entry** (TS/JS). Se o seu CSS local ainda tiver `@tailwind base|components|utilities`, comente ou remova para nao duplicar as camadas do Tailwind ja incluidas no bundle Kaizen.
|
|
44
|
+
|
|
45
|
+
**Opcao 2 — Migrar:** e feito um **backup** do arquivo principal (`.kaizen-backup`, ou `.kaizen-backup.<timestamp>` se ja existir). O arquivo e substituido por um `@import` do tema escolhido e um lembrete para reaplicar regras custom do backup **sem** repetir `@tailwind`. Imports diretos do tema no entry sao removidos para evitar duplicacao; se faltar, o wizard adiciona o `import` do CSS global no entry.
|
|
46
|
+
|
|
47
|
+
Com **varios** candidatos e **nenhum** importado pelo entry, o wizard lista os arquivos e pede qual migrar.
|
|
48
|
+
|
|
49
|
+
## Configuracao Tailwind (consumidor)
|
|
50
|
+
|
|
51
|
+
O Tailwind so gera classes que aparecem nos arquivos listados em `content`. As classes dos componentes (`text-kz-*`, `font-kz-*`, `rounded-kz-*`, etc.) ficam no **JS compilado** em `node_modules/@yberagroup/kaizen-ui/dist`. Por isso e obrigatorio incluir esse caminho; o `init` ja faz isso com `require.resolve`.
|
|
52
|
+
|
|
53
|
+
No `tailwind.config.cjs`:
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
const path = require("path");
|
|
57
|
+
|
|
58
|
+
const kaizenUiRoot = path.dirname(
|
|
59
|
+
require.resolve("@yberagroup/kaizen-ui/package.json"),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
module.exports = {
|
|
63
|
+
presets: [require("@yberagroup/kaizen-ui/tailwind-preset")],
|
|
64
|
+
content: [
|
|
65
|
+
"./index.html",
|
|
66
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
67
|
+
"./app/**/*.{js,ts,jsx,tsx}",
|
|
68
|
+
path.join(kaizenUiRoot, "dist", "**", "*.{js,mjs}"),
|
|
69
|
+
],
|
|
70
|
+
darkMode: "class",
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
No `postcss.config.cjs`:
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
module.exports = {
|
|
78
|
+
plugins: {
|
|
79
|
+
tailwindcss: {},
|
|
80
|
+
autoprefixer: {},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
No entry (ou no CSS global, apos migracao no wizard). Tema **esc**:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import "@yberagroup/kaizen-ui/globals/esc.css";
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Tema **group**: `import "@yberagroup/kaizen-ui/globals/group.css"`. O export `globals.css` neste pacote segue o tema esc.
|
|
92
|
+
|
|
93
|
+
## Exemplo
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import { Title } from "@yberagroup/kaizen-ui/components/title";
|
|
97
|
+
|
|
98
|
+
export function App() {
|
|
99
|
+
return <Title size="h2">Kaizen UI</Title>;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readFileSync,
|
|
4
|
+
writeFileSync,
|
|
5
|
+
existsSync,
|
|
6
|
+
copyFileSync,
|
|
7
|
+
unlinkSync,
|
|
8
|
+
} from "node:fs";
|
|
9
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
10
|
+
import process from "node:process";
|
|
11
|
+
import { createInterface } from "node:readline/promises";
|
|
12
|
+
import { stdin as input, stdout as output } from "node:process";
|
|
13
|
+
|
|
14
|
+
const THEME_IMPORT = {
|
|
15
|
+
esc: "@yberagroup/kaizen-ui/globals/esc.css",
|
|
16
|
+
group: "@yberagroup/kaizen-ui/globals/group.css",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function logStep(message) {
|
|
20
|
+
output.write(`\n[kaizen-ui] ${message}\n`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function detectEntryCandidates(cwd) {
|
|
24
|
+
return [
|
|
25
|
+
"src/main.tsx",
|
|
26
|
+
"src/main.jsx",
|
|
27
|
+
"src/index.tsx",
|
|
28
|
+
"src/index.jsx",
|
|
29
|
+
"app/layout.tsx",
|
|
30
|
+
"app/layout.jsx",
|
|
31
|
+
]
|
|
32
|
+
.map((p) => resolve(cwd, p))
|
|
33
|
+
.filter((p) => existsSync(p));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Caminhos comuns de CSS global (existentes no disco). */
|
|
37
|
+
function detectGlobalCssCandidates(cwd) {
|
|
38
|
+
const relPaths = [
|
|
39
|
+
"src/index.css",
|
|
40
|
+
"src/globals.css",
|
|
41
|
+
"src/global.css",
|
|
42
|
+
"src/styles/globals.css",
|
|
43
|
+
"src/styles/index.css",
|
|
44
|
+
"app/globals.css",
|
|
45
|
+
"styles/globals.css",
|
|
46
|
+
];
|
|
47
|
+
return relPaths
|
|
48
|
+
.map((p) => resolve(cwd, p))
|
|
49
|
+
.filter((p) => existsSync(p));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function findCssImportsFromEntry(entryPath) {
|
|
53
|
+
const source = readFileSync(entryPath, "utf-8");
|
|
54
|
+
const re = /import\s+["']([^"']+\.css)["']\s*;?/g;
|
|
55
|
+
const out = [];
|
|
56
|
+
let m;
|
|
57
|
+
while ((m = re.exec(source))) {
|
|
58
|
+
out.push(resolve(dirname(entryPath), m[1]));
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function hasTailwindDirectives(css) {
|
|
64
|
+
return /@tailwind\s+(base|components|utilities)\b/.test(css);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function pickMigrateTarget(cwd, entryPath, candidates) {
|
|
68
|
+
const fromEntry = findCssImportsFromEntry(entryPath);
|
|
69
|
+
for (const abs of fromEntry) {
|
|
70
|
+
if (candidates.includes(abs)) return abs;
|
|
71
|
+
}
|
|
72
|
+
return candidates[0];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function backupFile(absPath) {
|
|
76
|
+
let bak = `${absPath}.kaizen-backup`;
|
|
77
|
+
if (existsSync(bak)) {
|
|
78
|
+
bak = `${absPath}.kaizen-backup.${Date.now()}`;
|
|
79
|
+
}
|
|
80
|
+
copyFileSync(absPath, bak);
|
|
81
|
+
return bak;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function relativeImport(fromFile, toFile) {
|
|
85
|
+
let rel = relative(dirname(fromFile), toFile);
|
|
86
|
+
if (!rel.startsWith(".")) rel = `./${rel}`;
|
|
87
|
+
return rel.split("\\").join("/");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function ensureLocalCssImportInEntry(entryPath, cssAbsPath) {
|
|
91
|
+
const line = `import "${relativeImport(entryPath, cssAbsPath)}";`;
|
|
92
|
+
const source = readFileSync(entryPath, "utf-8");
|
|
93
|
+
if (source.includes(line)) return false;
|
|
94
|
+
const altSingle = line.replace(/"/g, "'");
|
|
95
|
+
if (source.includes(altSingle)) return false;
|
|
96
|
+
writeFileSync(entryPath, `${line}\n${source}`, "utf-8");
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function removeKaizenThemeImportsFromEntry(entryPath) {
|
|
101
|
+
let source = readFileSync(entryPath, "utf-8");
|
|
102
|
+
const lines = source.split("\n");
|
|
103
|
+
const themePrefixes = [
|
|
104
|
+
'@yberagroup/kaizen-ui/globals/esc.css',
|
|
105
|
+
'@yberagroup/kaizen-ui/globals/group.css',
|
|
106
|
+
'@yberagroup/kaizen-ui/globals.css',
|
|
107
|
+
];
|
|
108
|
+
const filtered = lines.filter((line) => {
|
|
109
|
+
const t = line.trim();
|
|
110
|
+
if (!t.startsWith("import ")) return true;
|
|
111
|
+
return !themePrefixes.some((p) => t.includes(p));
|
|
112
|
+
});
|
|
113
|
+
const next = filtered.join("\n");
|
|
114
|
+
if (next === source) return false;
|
|
115
|
+
writeFileSync(entryPath, next, "utf-8");
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function ensureImportInEntry(entryPath, importPath) {
|
|
120
|
+
const source = readFileSync(entryPath, "utf-8");
|
|
121
|
+
const importLine = `import "${importPath}";`;
|
|
122
|
+
if (source.includes(importLine)) return false;
|
|
123
|
+
|
|
124
|
+
const nextSource = `${importLine}\n${source}`;
|
|
125
|
+
writeFileSync(entryPath, nextSource, "utf-8");
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function writeTailwindConfig(cwd) {
|
|
130
|
+
const file = join(cwd, "tailwind.config.cjs");
|
|
131
|
+
const content = `/** @type {import('tailwindcss').Config} */
|
|
132
|
+
const path = require("path");
|
|
133
|
+
|
|
134
|
+
const kaizenUiRoot = path.dirname(
|
|
135
|
+
require.resolve("@yberagroup/kaizen-ui/package.json"),
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
module.exports = {
|
|
139
|
+
presets: [require("@yberagroup/kaizen-ui/tailwind-preset")],
|
|
140
|
+
content: [
|
|
141
|
+
"./index.html",
|
|
142
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
143
|
+
"./app/**/*.{js,ts,jsx,tsx}",
|
|
144
|
+
path.join(kaizenUiRoot, "dist", "**", "*.{js,mjs}"),
|
|
145
|
+
],
|
|
146
|
+
darkMode: "class",
|
|
147
|
+
};
|
|
148
|
+
`;
|
|
149
|
+
writeFileSync(file, content, "utf-8");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function writePostcssConfig(cwd) {
|
|
153
|
+
const file = join(cwd, "postcss.config.cjs");
|
|
154
|
+
const content = `module.exports = {
|
|
155
|
+
plugins: {
|
|
156
|
+
tailwindcss: {},
|
|
157
|
+
autoprefixer: {},
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
`;
|
|
161
|
+
writeFileSync(file, content, "utf-8");
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Remove configs legadas (.js/.mjs) para o Tailwind/PostCSS nao carregarem o arquivo errado ao lado do .cjs. */
|
|
165
|
+
function removeConflictingToolingConfigs(cwd) {
|
|
166
|
+
const names = [
|
|
167
|
+
"tailwind.config.js",
|
|
168
|
+
"tailwind.config.mjs",
|
|
169
|
+
"postcss.config.js",
|
|
170
|
+
"postcss.config.mjs",
|
|
171
|
+
];
|
|
172
|
+
for (const name of names) {
|
|
173
|
+
const abs = join(cwd, name);
|
|
174
|
+
if (!existsSync(abs)) continue;
|
|
175
|
+
unlinkSync(abs);
|
|
176
|
+
logStep(
|
|
177
|
+
`Removido ${name} (evita conflito com ${name.replace(/\.(js|mjs)$/i, ".cjs")}).`,
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async function runInit() {
|
|
183
|
+
const cwd = process.cwd();
|
|
184
|
+
const rl = createInterface({ input, output });
|
|
185
|
+
|
|
186
|
+
logStep("Inicializando setup do Kaizen UI...");
|
|
187
|
+
|
|
188
|
+
const themeAnswer = (
|
|
189
|
+
await rl.question("Escolha o tema (esc/group) [esc]: ")
|
|
190
|
+
).trim();
|
|
191
|
+
const theme = themeAnswer === "group" ? "group" : "esc";
|
|
192
|
+
|
|
193
|
+
const candidates = detectEntryCandidates(cwd);
|
|
194
|
+
const suggested = candidates[0] ?? "src/main.tsx";
|
|
195
|
+
const entryAnswer = (
|
|
196
|
+
await rl.question(`Arquivo de entrada para importar CSS [${suggested}]: `)
|
|
197
|
+
).trim();
|
|
198
|
+
const entryPath = resolve(cwd, entryAnswer || suggested);
|
|
199
|
+
|
|
200
|
+
if (!existsSync(entryPath)) {
|
|
201
|
+
rl.close();
|
|
202
|
+
throw new Error(`Arquivo de entrada não encontrado: ${entryPath}`);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const cssCandidates = detectGlobalCssCandidates(cwd);
|
|
206
|
+
let cssStrategy = "entry"; // "entry" | "migrate"
|
|
207
|
+
|
|
208
|
+
if (cssCandidates.length > 0) {
|
|
209
|
+
const list = cssCandidates
|
|
210
|
+
.map((p) => relative(cwd, p) || p)
|
|
211
|
+
.join(", ");
|
|
212
|
+
logStep(`Folhas de estilo globais encontradas: ${list}`);
|
|
213
|
+
const mode = (
|
|
214
|
+
await rl.question(
|
|
215
|
+
"Integração com CSS existente:\n [1] Manter locais — adiciono só o import do tema Kaizen no entry (evite @tailwind duplicado no seu CSS).\n [2] Migrar — backup do arquivo principal e substituo por import único do tema Kaizen (revise custom no .bak).\nEscolha [1]: ",
|
|
216
|
+
)
|
|
217
|
+
).trim();
|
|
218
|
+
cssStrategy = mode === "2" ? "migrate" : "entry";
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
writeTailwindConfig(cwd);
|
|
222
|
+
logStep("tailwind.config.cjs criado/atualizado.");
|
|
223
|
+
|
|
224
|
+
writePostcssConfig(cwd);
|
|
225
|
+
logStep("postcss.config.cjs criado/atualizado.");
|
|
226
|
+
|
|
227
|
+
removeConflictingToolingConfigs(cwd);
|
|
228
|
+
|
|
229
|
+
const themeImport = THEME_IMPORT[theme];
|
|
230
|
+
|
|
231
|
+
if (cssStrategy === "migrate") {
|
|
232
|
+
let target = pickMigrateTarget(cwd, entryPath, cssCandidates);
|
|
233
|
+
const fromEntry = findCssImportsFromEntry(entryPath);
|
|
234
|
+
const linked = cssCandidates.filter((c) => fromEntry.includes(c));
|
|
235
|
+
if (linked.length === 0 && cssCandidates.length > 1) {
|
|
236
|
+
const lines = cssCandidates
|
|
237
|
+
.map((p, i) => ` [${i + 1}] ${relative(cwd, p) || p}`)
|
|
238
|
+
.join("\n");
|
|
239
|
+
const n = (
|
|
240
|
+
await rl.question(
|
|
241
|
+
`Qual arquivo migrar?\n${lines}\nNúmero [1]: `,
|
|
242
|
+
)
|
|
243
|
+
).trim();
|
|
244
|
+
const idx = Math.max(0, Math.min(cssCandidates.length - 1, (parseInt(n, 10) || 1) - 1));
|
|
245
|
+
target = cssCandidates[idx];
|
|
246
|
+
}
|
|
247
|
+
const bak = backupFile(target);
|
|
248
|
+
logStep(`Backup: ${relative(cwd, bak) || bak}`);
|
|
249
|
+
|
|
250
|
+
const migratedBody = `/* kaizen-ui init: migração — tema ${theme}. Backup do conteúdo anterior: ${relative(cwd, bak) || bak} */
|
|
251
|
+
@import "${themeImport}";
|
|
252
|
+
|
|
253
|
+
/* Reaplique aqui regras do backup sem repetir @tailwind base/components/utilities. */
|
|
254
|
+
`;
|
|
255
|
+
writeFileSync(target, migratedBody, "utf-8");
|
|
256
|
+
logStep(`Arquivo atualizado: ${relative(cwd, target) || target}`);
|
|
257
|
+
|
|
258
|
+
removeKaizenThemeImportsFromEntry(entryPath);
|
|
259
|
+
if (ensureLocalCssImportInEntry(entryPath, target)) {
|
|
260
|
+
logStep(`Import do CSS global adicionado em ${entryPath}.`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const prev = readFileSync(bak, "utf-8");
|
|
264
|
+
if (hasTailwindDirectives(prev)) {
|
|
265
|
+
logStep(
|
|
266
|
+
"O backup continha @tailwind; o novo arquivo usa só o bundle Kaizen (sem duplicar camadas).",
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
const changed = ensureImportInEntry(entryPath, themeImport);
|
|
271
|
+
if (changed) {
|
|
272
|
+
logStep(`Import do tema ${theme} adicionado em ${entryPath}.`);
|
|
273
|
+
} else {
|
|
274
|
+
logStep(`Import já existente em ${entryPath}.`);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (cssCandidates.length > 0) {
|
|
278
|
+
for (const p of cssCandidates) {
|
|
279
|
+
const css = readFileSync(p, "utf-8");
|
|
280
|
+
if (hasTailwindDirectives(css)) {
|
|
281
|
+
logStep(
|
|
282
|
+
`Aviso: ${relative(cwd, p) || p} contém @tailwind — comente ou remova para não duplicar o Tailwind junto com Kaizen.`,
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
rl.close();
|
|
290
|
+
logStep("Concluído.");
|
|
291
|
+
output.write(
|
|
292
|
+
"\nPróximos passos:\n- npm i @yberagroup/kaizen-ui @yberagroup/kaizen-tokens tailwindcss postcss autoprefixer\n- npm run dev\n",
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
async function main() {
|
|
297
|
+
const command = process.argv[2];
|
|
298
|
+
if (!command || command === "init") {
|
|
299
|
+
await runInit();
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
output.write(`Comando não suportado: ${command}\n`);
|
|
304
|
+
output.write("Uso: npx @yberagroup/kaizen-ui init\n");
|
|
305
|
+
process.exitCode = 1;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
main().catch((error) => {
|
|
309
|
+
output.write(`\n[kaizen-ui] Erro: ${error.message}\n`);
|
|
310
|
+
process.exitCode = 1;
|
|
311
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
export type TitleSize = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
4
|
+
export type TitleWeight = "medium" | "semibold";
|
|
5
|
+
declare const titleVariants: (props?: ({
|
|
6
|
+
size?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null | undefined;
|
|
7
|
+
weight?: "medium" | "semibold" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export type TitleProps = React.HTMLAttributes<HTMLHeadingElement> & VariantProps<typeof titleVariants> & {
|
|
10
|
+
size?: TitleSize;
|
|
11
|
+
weight?: TitleWeight;
|
|
12
|
+
};
|
|
13
|
+
declare function Title({ size, weight, className, ...props }: TitleProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { Title };
|
|
15
|
+
//# sourceMappingURL=title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../src/components/title.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAChE,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEhD,QAAA,MAAM,aAAa;;;8EAsBlB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAC/D,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEJ,iBAAS,KAAK,CAAC,EACb,IAAW,EACX,MAAiB,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,UAAU,2CASZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
const titleVariants = cva("typeface-kz-syne tracking-kz-0 text-text-primary-dark leading-kz-0 p-0 m-0", {
|
|
5
|
+
variants: {
|
|
6
|
+
size: {
|
|
7
|
+
h1: "text-kz-40 leading-kz-48",
|
|
8
|
+
h2: "text-kz-32 leading-kz-40",
|
|
9
|
+
h3: "text-kz-24 leading-kz-32",
|
|
10
|
+
h4: "text-kz-18 leading-kz-24",
|
|
11
|
+
h5: "text-kz-16 leading-kz-22",
|
|
12
|
+
h6: "text-kz-14 leading-kz-20",
|
|
13
|
+
},
|
|
14
|
+
weight: {
|
|
15
|
+
medium: "font-kz-500",
|
|
16
|
+
semibold: "font-kz-600",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
size: "h2",
|
|
21
|
+
weight: "medium",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
function Title({ size = "h2", weight = "medium", className, ...props }) {
|
|
25
|
+
const Tag = size;
|
|
26
|
+
return (_jsx(Tag, { className: clsx(titleVariants({ size, weight }), className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Title };
|
|
29
|
+
//# sourceMappingURL=title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.js","sourceRoot":"","sources":["../../src/components/title.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAK5B,MAAM,aAAa,GAAG,GAAG,CACvB,4EAA4E,EAC5E;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,EAAE,EAAE,0BAA0B;YAC9B,EAAE,EAAE,0BAA0B;YAC9B,EAAE,EAAE,0BAA0B;YAC9B,EAAE,EAAE,0BAA0B;YAC9B,EAAE,EAAE,0BAA0B;YAC9B,EAAE,EAAE,0BAA0B;SAC/B;QACD,MAAM,EAAE;YACN,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE,aAAa;SACxB;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,QAAQ;KACjB;CACF,CACF,CAAC;AAQF,SAAS,KAAK,CAAC,EACb,IAAI,GAAG,IAAI,EACX,MAAM,GAAG,QAAQ,EACjB,SAAS,EACT,GAAG,KAAK,EACG;IACX,MAAM,GAAG,GAAG,IAAI,CAAC;IAEjB,OAAO,CACL,KAAC,GAAG,IACF,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export de ícones Font Awesome Pro para uso no design system.
|
|
3
|
+
* Conta Pro: mais ícones e estilos (solid, regular, light, thin, duotone).
|
|
4
|
+
* Para outros ícones, importe de @fortawesome/pro-solid-svg-icons ou pro-regular-svg-icons.
|
|
5
|
+
*/
|
|
6
|
+
export { faCheck, faChevronDown, faChevronLeft, faChevronRight, faChevronUp, faCircleInfo, faXmark, faPlus, faMinus, faMagnifyingGlass, faBars, faEllipsis, faEllipsisVertical, faUser, faGear, faArrowRight, faArrowLeft, faExternalLink, faTriangleExclamation, faCircleCheck, faCircleXmark, } from "@fortawesome/pro-solid-svg-icons";
|
|
7
|
+
export { faCircleQuestion, faUser as faUserRegular, } from "@fortawesome/pro-regular-svg-icons";
|
|
8
|
+
export { faFacebook, faInstagram, faLinkedin, faTwitter, faXTwitter, faYoutube, faWhatsapp, faGoogle, faGithub, faSpotify, faApple, faMicrosoft, } from "@fortawesome/free-brands-svg-icons";
|
|
9
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/lib/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,OAAO,EACP,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,MAAM,EACN,YAAY,EACZ,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,aAAa,GACd,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACL,gBAAgB,EAChB,MAAM,IAAI,aAAa,GACxB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAW,GACZ,MAAM,oCAAoC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export de ícones Font Awesome Pro para uso no design system.
|
|
3
|
+
* Conta Pro: mais ícones e estilos (solid, regular, light, thin, duotone).
|
|
4
|
+
* Para outros ícones, importe de @fortawesome/pro-solid-svg-icons ou pro-regular-svg-icons.
|
|
5
|
+
*/
|
|
6
|
+
export { faCheck, faChevronDown, faChevronLeft, faChevronRight, faChevronUp, faCircleInfo, faXmark, faPlus, faMinus, faMagnifyingGlass, faBars, faEllipsis, faEllipsisVertical, faUser, faGear, faArrowRight, faArrowLeft, faExternalLink, faTriangleExclamation, faCircleCheck, faCircleXmark, } from "@fortawesome/pro-solid-svg-icons";
|
|
7
|
+
export { faCircleQuestion, faUser as faUserRegular, } from "@fortawesome/pro-regular-svg-icons";
|
|
8
|
+
export { faFacebook, faInstagram, faLinkedin, faTwitter, faXTwitter, faYoutube, faWhatsapp, faGoogle, faGithub, faSpotify, faApple, faMicrosoft, } from "@fortawesome/free-brands-svg-icons";
|
|
9
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/lib/icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,OAAO,EACP,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,OAAO,EACP,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,MAAM,EACN,YAAY,EACZ,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,aAAa,GACd,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACL,gBAAgB,EAChB,MAAM,IAAI,aAAa,GACxB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAW,GACZ,MAAM,oCAAoC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yberagroup/kaizen-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
7
|
+
"build": "tsc -p tsconfig.build.json",
|
|
8
|
+
"lint": "eslint . --max-warnings 0",
|
|
9
|
+
"prepublishOnly": "npm run build && npm run lint"
|
|
8
10
|
},
|
|
9
11
|
"dependencies": {
|
|
10
|
-
"@yberagroup/kaizen-tokens": "^0.0.
|
|
12
|
+
"@yberagroup/kaizen-tokens": "^0.0.4",
|
|
11
13
|
"class-variance-authority": "^0.7.1",
|
|
12
14
|
"clsx": "^2.1.1",
|
|
13
15
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
@@ -15,33 +17,49 @@
|
|
|
15
17
|
"@fortawesome/pro-solid-svg-icons": "^6.7.2",
|
|
16
18
|
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
17
19
|
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
18
|
-
"
|
|
19
|
-
"radix-ui": "^1.4.3",
|
|
20
|
-
"react": "^19.2.4",
|
|
21
|
-
"react-dom": "^19.2.4",
|
|
22
|
-
"tailwind-merge": "^3.4.0",
|
|
23
|
-
"tw-animate-css": "^1.4.0",
|
|
24
|
-
"zod": "^3.25.76"
|
|
20
|
+
"tailwind-merge": "^3.4.0"
|
|
25
21
|
},
|
|
26
22
|
"devDependencies": {
|
|
27
|
-
"@tailwindcss/postcss": "^4.1.18",
|
|
28
|
-
"@turbo/gen": "^2.8.1",
|
|
29
23
|
"@types/node": "^25.1.0",
|
|
30
24
|
"@types/react": "^19.2.10",
|
|
31
25
|
"@types/react-dom": "^19.2.3",
|
|
32
26
|
"@workspace/eslint-config": "file:../eslint-config",
|
|
33
27
|
"@workspace/typescript-config": "file:../typescript-config",
|
|
28
|
+
"autoprefixer": "^10.4.21",
|
|
34
29
|
"eslint": "^9.39.2",
|
|
35
|
-
"
|
|
30
|
+
"postcss": "^8.5.6",
|
|
31
|
+
"tailwindcss": "^3.4.17",
|
|
32
|
+
"react": "^19.2.4",
|
|
33
|
+
"react-dom": "^19.2.4",
|
|
36
34
|
"typescript": "^5.9.3"
|
|
37
35
|
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
38
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
39
|
+
"tailwindcss": "^3.4.0"
|
|
40
|
+
},
|
|
41
|
+
"bin": {
|
|
42
|
+
"kaizen-ui": "./bin/kaizen-ui.mjs"
|
|
43
|
+
},
|
|
38
44
|
"exports": {
|
|
39
45
|
"./globals.css": "./src/styles/globals.css",
|
|
46
|
+
"./globals/esc.css": "./src/styles/globals.esc.css",
|
|
47
|
+
"./globals/group.css": "./src/styles/globals.group.css",
|
|
40
48
|
"./postcss.config": "./postcss.config.mjs",
|
|
41
|
-
"./
|
|
42
|
-
"./
|
|
43
|
-
"./
|
|
49
|
+
"./tailwind-preset": "./tailwind-preset.cjs",
|
|
50
|
+
"./lib/*": "./dist/lib/*.js",
|
|
51
|
+
"./components/*": "./dist/components/*.js",
|
|
52
|
+
"./hooks/*": "./dist/hooks/*.js"
|
|
44
53
|
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"src/styles",
|
|
57
|
+
"postcss.config.mjs",
|
|
58
|
+
"tailwind-preset.cjs",
|
|
59
|
+
"bin",
|
|
60
|
+
"README.md",
|
|
61
|
+
"components.json"
|
|
62
|
+
],
|
|
45
63
|
"publishConfig": {
|
|
46
64
|
"access": "public"
|
|
47
65
|
}
|
package/postcss.config.mjs
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@500;600&family=Syne:wght@500;600&display=swap");
|
|
2
|
+
|
|
3
|
+
@import "@yberagroup/kaizen-tokens/foundations.css";
|
|
4
|
+
@tailwind base;
|
|
5
|
+
@tailwind components;
|
|
6
|
+
@tailwind utilities;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Typefaces: primitivos --kz-syne e --kz-nunitosans vêm de kaizen-foundations (foundations.css).
|
|
10
|
+
* next/font injeta --font-sans (Syne) e --font-nunito (Nunito Sans) no layout da app.
|
|
11
|
+
*
|
|
12
|
+
* Usamos classes typeface-kz-* (não font-kz-*) para não colidir com pesos tipográficos (font-kz-500/600):
|
|
13
|
+
* o tailwind-merge trata qualquer utilitário "font-*" como o mesmo grupo e acaba removendo a família.
|
|
14
|
+
*/
|
|
15
|
+
@layer utilities {
|
|
16
|
+
.typeface-kz-syne {
|
|
17
|
+
font-family: var(--font-sans, var(--kz-syne)), "Syne", sans-serif;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.typeface-kz-nunitosans {
|
|
21
|
+
font-family:
|
|
22
|
+
var(--font-nunito, var(--kz-nunitosans)), "Nunito Sans", sans-serif;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@layer base {
|
|
27
|
+
* {
|
|
28
|
+
@apply border-border-primary outline-border-input-selected;
|
|
29
|
+
}
|
|
30
|
+
body {
|
|
31
|
+
@apply bg-background-primary text-text-primary-dark;
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/styles/globals.css
CHANGED
|
@@ -1,36 +1,2 @@
|
|
|
1
|
-
@import "
|
|
2
|
-
@
|
|
3
|
-
@source "../**/*.{ts,tsx}";
|
|
4
|
-
@import "@yberagroup/kaizen-tokens/foundations.css";
|
|
5
|
-
@import "@yberagroup/kaizen-tokens/themes/esc.css"; /* ou group.css */
|
|
6
|
-
@import "@yberagroup/kaizen-tokens/tailwind-semantic-theme.css";
|
|
7
|
-
@import "tw-animate-css";
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* Typefaces: primitivos --kz-syne e --kz-nunitosans vêm de kaizen-foundations (foundations.css).
|
|
11
|
-
* next/font injeta --font-sans (Syne) e --font-nunito (Nunito Sans) no layout da app.
|
|
12
|
-
*
|
|
13
|
-
* Usamos classes typeface-kz-* (não font-kz-*) para não colidir com pesos tipográficos (font-kz-500/600):
|
|
14
|
-
* o tailwind-merge trata qualquer utilitário "font-*" como o mesmo grupo e acaba removendo a família.
|
|
15
|
-
*/
|
|
16
|
-
@layer utilities {
|
|
17
|
-
.typeface-kz-syne {
|
|
18
|
-
font-family: var(--font-sans, var(--kz-syne)), "Syne", sans-serif;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.typeface-kz-nunitosans {
|
|
22
|
-
font-family:
|
|
23
|
-
var(--font-nunito, var(--kz-nunitosans)), "Nunito Sans", sans-serif;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@custom-variant dark (&:is(.dark *));
|
|
28
|
-
|
|
29
|
-
@layer base {
|
|
30
|
-
* {
|
|
31
|
-
@apply border-border-primary outline-border-input-selected/50;
|
|
32
|
-
}
|
|
33
|
-
body {
|
|
34
|
-
@apply bg-background-primary text-text-primary-dark;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
@import "@yberagroup/kaizen-tokens/themes/esc.css";
|
|
2
|
+
@import "./globals.base.css";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* global module, require */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
3
|
+
|
|
4
|
+
const foundations = require("@yberagroup/kaizen-tokens/foundations");
|
|
5
|
+
const semanticBase = require("@yberagroup/kaizen-tokens/semantic-base");
|
|
6
|
+
|
|
7
|
+
function buildSemanticColors() {
|
|
8
|
+
const keys = new Set(Object.keys(semanticBase));
|
|
9
|
+
keys.add("background-primary");
|
|
10
|
+
|
|
11
|
+
const semanticColors = {};
|
|
12
|
+
for (const key of keys) {
|
|
13
|
+
semanticColors[key] = `var(--color-${key})`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return semanticColors;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function buildPrimitiveKzColors() {
|
|
20
|
+
const kz = {};
|
|
21
|
+
const colors = foundations.colors ?? {};
|
|
22
|
+
const system = colors.system ?? {};
|
|
23
|
+
|
|
24
|
+
for (const [palette, scales] of Object.entries(system)) {
|
|
25
|
+
kz[palette] = {};
|
|
26
|
+
for (const step of Object.keys(scales)) {
|
|
27
|
+
kz[palette][step] = `var(--color-kz-${palette}-${step})`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const palette of ["group", "club"]) {
|
|
32
|
+
if (!colors[palette]) continue;
|
|
33
|
+
kz[palette] = {};
|
|
34
|
+
for (const step of Object.keys(colors[palette])) {
|
|
35
|
+
kz[palette][step] = `var(--color-kz-${palette}-${step})`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (colors.escritorio) {
|
|
40
|
+
kz.esc = {};
|
|
41
|
+
for (const step of Object.keys(colors.escritorio)) {
|
|
42
|
+
kz.esc[step] = `var(--color-kz-esc-${step})`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
kz.alfa = {};
|
|
47
|
+
for (const mode of ["light", "dark"]) {
|
|
48
|
+
const modeValues = colors.alfa?.[mode] ?? {};
|
|
49
|
+
for (const step of Object.keys(modeValues)) {
|
|
50
|
+
kz.alfa[step] = kz.alfa[step] ?? {};
|
|
51
|
+
kz.alfa[step][mode] = `var(--color-kz-alfa-${step}-${mode})`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return kz;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function buildPrefixedScale(values, cssVarPrefix) {
|
|
59
|
+
const out = {};
|
|
60
|
+
for (const key of Object.keys(values ?? {})) {
|
|
61
|
+
out[`kz-${key}`] = `var(${cssVarPrefix}${key})`;
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = {
|
|
67
|
+
theme: {
|
|
68
|
+
extend: {
|
|
69
|
+
colors: {
|
|
70
|
+
...buildSemanticColors(),
|
|
71
|
+
kz: buildPrimitiveKzColors(),
|
|
72
|
+
},
|
|
73
|
+
spacing: buildPrefixedScale(foundations.layout?.space, "--space-kz-"),
|
|
74
|
+
borderRadius: buildPrefixedScale(
|
|
75
|
+
foundations.layout?.border?.radius,
|
|
76
|
+
"--rounded-kz-",
|
|
77
|
+
),
|
|
78
|
+
borderWidth: buildPrefixedScale(
|
|
79
|
+
foundations.layout?.border?.width,
|
|
80
|
+
"--border-kz-",
|
|
81
|
+
),
|
|
82
|
+
fontSize: buildPrefixedScale(foundations.text?.fontsize, "--kz-text-"),
|
|
83
|
+
lineHeight: buildPrefixedScale(
|
|
84
|
+
foundations.text?.lineheight,
|
|
85
|
+
"--kz-leading-",
|
|
86
|
+
),
|
|
87
|
+
fontWeight: buildPrefixedScale(
|
|
88
|
+
foundations.text?.weight,
|
|
89
|
+
"--kz-font-weight-",
|
|
90
|
+
),
|
|
91
|
+
letterSpacing: {
|
|
92
|
+
"kz-0": "0",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
package/eslint.config.js
DELETED
package/src/components/.gitkeep
DELETED
|
File without changes
|
package/src/components/title.tsx
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
|
|
5
|
-
export type TitleSize = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
6
|
-
export type TitleWeight = "medium" | "semibold";
|
|
7
|
-
|
|
8
|
-
const titleVariants = cva(
|
|
9
|
-
"typeface-kz-syne tracking-kz-0 text-text-primary-dark leading-kz-0 p-0 m-0",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
size: {
|
|
13
|
-
h1: "text-kz-40 leading-kz-48",
|
|
14
|
-
h2: "text-kz-32 leading-kz-40",
|
|
15
|
-
h3: "text-kz-24 leading-kz-32",
|
|
16
|
-
h4: "text-kz-18 leading-kz-24",
|
|
17
|
-
h5: "text-kz-16 leading-kz-22",
|
|
18
|
-
h6: "text-kz-14 leading-kz-20",
|
|
19
|
-
},
|
|
20
|
-
weight: {
|
|
21
|
-
medium: "font-kz-500",
|
|
22
|
-
semibold: "font-kz-600",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
size: "h2",
|
|
27
|
-
weight: "medium",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export type TitleProps = React.HTMLAttributes<HTMLHeadingElement> &
|
|
33
|
-
VariantProps<typeof titleVariants> & {
|
|
34
|
-
size?: TitleSize;
|
|
35
|
-
weight?: TitleWeight;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
function Title({
|
|
39
|
-
size = "h2",
|
|
40
|
-
weight = "medium",
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: TitleProps) {
|
|
44
|
-
const Tag = size;
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<Tag
|
|
48
|
-
className={clsx(titleVariants({ size, weight }), className)}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { Title };
|
package/src/hooks/.gitkeep
DELETED
|
File without changes
|
package/src/lib/icons.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Re-export de ícones Font Awesome Pro para uso no design system.
|
|
3
|
-
* Conta Pro: mais ícones e estilos (solid, regular, light, thin, duotone).
|
|
4
|
-
* Para outros ícones, importe de @fortawesome/pro-solid-svg-icons ou pro-regular-svg-icons.
|
|
5
|
-
*/
|
|
6
|
-
export {
|
|
7
|
-
faCheck,
|
|
8
|
-
faChevronDown,
|
|
9
|
-
faChevronLeft,
|
|
10
|
-
faChevronRight,
|
|
11
|
-
faChevronUp,
|
|
12
|
-
faCircleInfo,
|
|
13
|
-
faXmark,
|
|
14
|
-
faPlus,
|
|
15
|
-
faMinus,
|
|
16
|
-
faMagnifyingGlass,
|
|
17
|
-
faBars,
|
|
18
|
-
faEllipsis,
|
|
19
|
-
faEllipsisVertical,
|
|
20
|
-
faUser,
|
|
21
|
-
faGear,
|
|
22
|
-
faArrowRight,
|
|
23
|
-
faArrowLeft,
|
|
24
|
-
faExternalLink,
|
|
25
|
-
faTriangleExclamation,
|
|
26
|
-
faCircleCheck,
|
|
27
|
-
faCircleXmark,
|
|
28
|
-
} from "@fortawesome/pro-solid-svg-icons"
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
faCircleQuestion,
|
|
32
|
-
faUser as faUserRegular,
|
|
33
|
-
} from "@fortawesome/pro-regular-svg-icons"
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
faFacebook,
|
|
37
|
-
faInstagram,
|
|
38
|
-
faLinkedin,
|
|
39
|
-
faTwitter,
|
|
40
|
-
faXTwitter,
|
|
41
|
-
faYoutube,
|
|
42
|
-
faWhatsapp,
|
|
43
|
-
faGoogle,
|
|
44
|
-
faGithub,
|
|
45
|
-
faSpotify,
|
|
46
|
-
faApple,
|
|
47
|
-
faMicrosoft,
|
|
48
|
-
} from "@fortawesome/free-brands-svg-icons"
|
package/src/lib/utils.ts
DELETED
package/tsconfig.json
DELETED