zark-design 1.0.0 → 2.0.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.
Files changed (64) hide show
  1. package/bin/cli.js +7 -6
  2. package/package.json +2 -2
  3. package/templates/README.md +264 -0
  4. package/templates/html/components.css +740 -0
  5. package/templates/html/index.html +135 -0
  6. package/templates/html/showcase.html +3550 -0
  7. package/templates/{tokens.css → html/tokens.css} +89 -112
  8. package/templates/jsx/App.example.jsx +229 -0
  9. package/templates/jsx/components/AlertCritical.jsx +43 -0
  10. package/templates/jsx/components/Avatar.jsx +41 -0
  11. package/templates/jsx/components/Badge.jsx +12 -0
  12. package/templates/jsx/components/Banner.jsx +42 -0
  13. package/templates/jsx/components/Button.jsx +43 -0
  14. package/templates/jsx/components/Chip.jsx +28 -0
  15. package/templates/jsx/components/CodeBlock.jsx +42 -0
  16. package/templates/jsx/components/EmptyState.jsx +27 -0
  17. package/templates/jsx/components/Funnel.jsx +55 -0
  18. package/templates/jsx/components/Input.jsx +53 -0
  19. package/templates/jsx/components/KanbanColumn.jsx +51 -0
  20. package/templates/jsx/components/Kbd.jsx +11 -0
  21. package/templates/jsx/components/LeadCard.jsx +79 -0
  22. package/templates/jsx/components/Modal.jsx +57 -0
  23. package/templates/jsx/components/Panel.jsx +25 -0
  24. package/templates/jsx/components/Section.jsx +28 -0
  25. package/templates/jsx/components/Segmented.jsx +26 -0
  26. package/templates/jsx/components/Sidebar.jsx +49 -0
  27. package/templates/jsx/components/Spec.jsx +19 -0
  28. package/templates/jsx/components/StatCard.jsx +44 -0
  29. package/templates/jsx/components/TableActions.jsx +34 -0
  30. package/templates/jsx/components/Tag.jsx +21 -0
  31. package/templates/jsx/components/TagDot.jsx +26 -0
  32. package/templates/jsx/components/Toast.jsx +25 -0
  33. package/templates/jsx/components/Toggle.jsx +29 -0
  34. package/templates/jsx/components.css +740 -0
  35. package/templates/{icons.jsx → jsx/icons.jsx} +20 -9
  36. package/templates/jsx/index.js +31 -0
  37. package/templates/jsx/tokens.css +283 -0
  38. package/templates/jsx/tokens.js +62 -0
  39. package/templates/REFERENCE.md +0 -376
  40. package/templates/SHOWCASE.html +0 -254
  41. package/templates/brand.jsx +0 -89
  42. package/templates/components.jsx +0 -385
  43. package/templates/design-canvas.jsx +0 -789
  44. package/templates/foundations.jsx +0 -363
  45. package/templates/layouts.jsx +0 -232
  46. package/templates/patterns.jsx +0 -268
  47. package/templates/primitives.jsx +0 -306
  48. package/templates/visual-references/pasted-1777605750385-0.png +0 -0
  49. package/templates/visual-references/pasted-1777605766298-0.png +0 -0
  50. package/templates/visual-references/pasted-1777605775820-0.png +0 -0
  51. package/templates/visual-references/pasted-1777605789833-0.png +0 -0
  52. package/templates/visual-references/pasted-1777605802420-0.png +0 -0
  53. package/templates/visual-references/pasted-1777605812470-0.png +0 -0
  54. package/templates/visual-references/pasted-1777605817688-0.png +0 -0
  55. package/templates/visual-references/pasted-1777605828485-0.png +0 -0
  56. package/templates/visual-references/pasted-1777605837137-0.png +0 -0
  57. package/templates/visual-references/pasted-1777605849789-0.png +0 -0
  58. package/templates/visual-references/pasted-1777605864942-0.png +0 -0
  59. package/templates/visual-references/pasted-1777605877920-0.png +0 -0
  60. package/templates/visual-references/pasted-1777605897353-0.png +0 -0
  61. /package/templates/{assets/zark-logo.png → html/assets/logo-zark-laranja.png} +0 -0
  62. /package/templates/{assets → html/assets}/zark-icon.png +0 -0
  63. /package/templates/{visual-references/logo-zark-principal.png → jsx/assets/logo-zark-laranja.png} +0 -0
  64. /package/templates/{visual-references/icon-zark.png → jsx/assets/zark-icon.png} +0 -0
package/bin/cli.js CHANGED
@@ -49,7 +49,7 @@ async function copyDir(src, dest) {
49
49
  }
50
50
 
51
51
  async function appendNoteToContextFiles(targetRoot, designDirName) {
52
- const note = `\n\n## Design system\nEste projeto usa o **ZARK Design System**. Antes de qualquer trabalho de UI/frontend, leia \`${designDirName}/REFERENCE.md\` (descreve tokens, primitivos, layouts e patterns). Os arquivos \`.jsx\` em \`${designDirName}/\` são REFERÊNCIA visual e estrutural adapte pra stack atual do projeto (React/Vue/Svelte/Blade/Django templates/etc.), não copie literal. Os PNGs em \`${designDirName}/visual-references/\` são ground truth visual.\n`;
52
+ const note = `\n\n## Design system\nEste projeto usa o **ZARK Design System (Apps)**. Antes de qualquer trabalho de UI/frontend, leia \`${designDirName}/README.md\` descreve tokens, primitivos, App Patterns (StatCard, Funnel, KanbanColumn, LeadCard, AlertCritical, EmptyState, TableActions), 35 ícones e regras de uso.\n\nDuas implementações lado a lado consumindo os MESMOS \`tokens.css\` + \`components.css\`:\n- \`${designDirName}/html/\` — HTML puro com classes (\`.btn\`, \`.tag-dot\`, \`.stat\` …). Use em projetos Blade/Django/Rails/HTML.\n- \`${designDirName}/jsx/\` React (24 componentes individuais em \`components/\`). Use em projetos React/Next.\n\nPara Vue/Svelte/Solid, use \`tokens.css\` + \`components.css\` direto e adapte os componentes JSX mantendo as classes CSS.\n\nAbra \`${designDirName}/html/showcase.html\` no browser pra ver tudo renderizado (light/dark toggle).\n`;
53
53
 
54
54
  const candidates = [
55
55
  path.join(targetRoot, '.ai-context', 'CONTEXT.md'),
@@ -87,9 +87,10 @@ function printHelp(version) {
87
87
  console.log(` npx zark-design init ./ui ${c.dim('# instala em ./ui')}`);
88
88
  console.log(` npx zark-design init --force ${c.dim('# sobrescreve se já existe')}\n`);
89
89
  console.log(` ${c.bold('Filosofia:')}`);
90
- console.log(` Os arquivos JSX são ${c.bold('REFERÊNCIA')} pra IA, não pra runtime.`);
91
- console.log(` A IA REFERENCE.md + visual-references/ e adapta pra stack atual`);
92
- console.log(` do projeto (React, Vue, Svelte, Blade, Django, HTML puro, etc.).\n`);
90
+ console.log(` Cria pasta com 2 implementações lado a lado: ${c.bold('html/')} e ${c.bold('jsx/')}.`);
91
+ console.log(` Ambas consomem os MESMOS tokens.css + components.css.`);
92
+ console.log(` A IA README.md, escolhe a versão certa pra stack do projeto`);
93
+ console.log(` (React→jsx · Blade/Django/HTML→html · Vue/Svelte→adapta classes).\n`);
93
94
  }
94
95
 
95
96
  async function runInit(args) {
@@ -142,8 +143,8 @@ async function runInit(args) {
142
143
  console.log(c.green(`✓ Design system instalado em ${designDirName}/`));
143
144
  console.log('');
144
145
  console.log(c.bold('Próximo passo:'));
145
- console.log(` Diga pra IA: ${c.dim(`"use o design system em ${designDirName}/ como referência exata pra UI"`)}`);
146
- console.log(` Ou abra ${designDirName}/SHOWCASE.html no browser pra ver o sistema.`);
146
+ console.log(` ${c.dim('•')} Diga pra IA: "use o design system em ${designDirName}/ como referência (leia README.md)"`);
147
+ console.log(` ${c.dim('•')} Ou abra ${designDirName}/html/showcase.html no browser pra ver tudo renderizado.`);
147
148
  }
148
149
 
149
150
  async function main() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zark-design",
3
- "version": "1.0.0",
4
- "description": "ZARK SAAS Design System — install via `npx zark-design init` to drop the design system as REFERENCE for AI in any project (any stack).",
3
+ "version": "2.0.0",
4
+ "description": "ZARK SAAS Design System (Apps) — install via `npx zark-design init` to drop the design system in any project. Ships HTML + JSX side-by-side, both consuming the same tokens.css + components.css, with App Patterns derived from the ZARK CRM.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "zark-design": "bin/cli.js"
@@ -0,0 +1,264 @@
1
+ # ZARK Design System — Apps
2
+
3
+ Sistema de design para apps e sistemas internos da ZARK. Disponível em **HTML puro** e **React (JSX)**, ambos consumindo as mesmas folhas de estilo (`tokens.css` + `components.css`).
4
+
5
+ Versão: **v3 · 2026** · App Patterns derivados do CRM real.
6
+
7
+ ---
8
+
9
+ ## Estrutura
10
+
11
+ ```
12
+ design-system-apps/
13
+ ├── README.md ← você está aqui
14
+
15
+ ├── html/ ← versão HTML pura
16
+ │ ├── tokens.css ← variáveis CSS (cores, tipografia, espaçamento)
17
+ │ ├── components.css ← classes de componente (.btn, .tag-dot, .stat...)
18
+ │ ├── index.html ← exemplo mínimo de uso
19
+ │ ├── showcase.html ← galeria completa interativa
20
+ │ └── assets/
21
+ │ ├── logo-zark-laranja.png
22
+ │ └── zark-icon.png
23
+
24
+ └── jsx/ ← versão React
25
+ ├── tokens.css ← (idêntico ao html/tokens.css)
26
+ ├── components.css ← (idêntico ao html/components.css)
27
+ ├── tokens.js ← tokens em JS para inline styles / charts
28
+ ├── icons.jsx ← 35 ícones outline
29
+ ├── index.js ← barrel export
30
+ ├── App.example.jsx ← exemplo completo de uso
31
+ ├── components/
32
+ │ ├── Button.jsx
33
+ │ ├── Input.jsx ← + UrlInputFull
34
+ │ ├── Tag.jsx
35
+ │ ├── TagDot.jsx ← status, priority, space
36
+ │ ├── Badge.jsx
37
+ │ ├── Toggle.jsx
38
+ │ ├── Segmented.jsx
39
+ │ ├── Chip.jsx ← filter chips
40
+ │ ├── StatCard.jsx ← KPI card unificado
41
+ │ ├── AlertCritical.jsx ← banner vermelho de ação imediata
42
+ │ ├── Funnel.jsx ← + ProgressBar
43
+ │ ├── EmptyState.jsx
44
+ │ ├── KanbanColumn.jsx ← + KanbanBoard
45
+ │ ├── LeadCard.jsx ← Pipeline
46
+ │ ├── TableActions.jsx ← check / edit / delete
47
+ │ ├── Sidebar.jsx ← + SidebarLink, SidebarSection
48
+ │ ├── Panel.jsx ← card padrão
49
+ │ ├── Section.jsx ← bloco de página
50
+ │ ├── Modal.jsx
51
+ │ ├── Toast.jsx
52
+ │ ├── Banner.jsx ← Announce + Tip
53
+ │ ├── CodeBlock.jsx
54
+ │ ├── Avatar.jsx ← + AvatarSpace
55
+ │ ├── Kbd.jsx
56
+ │ └── Spec.jsx
57
+ └── assets/
58
+ ├── logo-zark-laranja.png
59
+ └── zark-icon.png
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Filosofia
65
+
66
+ **Warm, neutral, ember-on-paper.**
67
+ - `--paper` (#fafaf8) cremoso, NÃO branco puro.
68
+ - `--ember-500` (#f56f10 — Liquid Lava) é a única cor de marca. Use com **moderação** em CTAs, focus, brand moments.
69
+ - Hairlines de 1px em `--line-200`. Nunca borders grossos.
70
+ - Sombras warm (`rgba(20,17,12,...)`), nunca azuis-frias.
71
+ - Tipografia editorial: **Inter** pra UI e números · **JetBrains Mono** pra código e labels · **Space Grotesk** pra títulos.
72
+ - **Sem pill.** Tags, chips, toggles, badges usam raio sm/md (4-6px). Avatares usam 50% (são círculos geométricos, não pills).
73
+
74
+ ---
75
+
76
+ ## Como usar — HTML puro
77
+
78
+ 1. Importe os 2 CSS no `<head>`:
79
+
80
+ ```html
81
+ <link rel="preconnect" href="https://fonts.googleapis.com"/>
82
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet"/>
83
+
84
+ <link rel="stylesheet" href="/path/to/tokens.css"/>
85
+ <link rel="stylesheet" href="/path/to/components.css"/>
86
+ ```
87
+
88
+ 2. Use as classes diretamente:
89
+
90
+ ```html
91
+ <button class="btn btn-primary btn-md">Nova Tarefa</button>
92
+
93
+ <span class="tag-dot s-todo">A FAZER</span>
94
+ <span class="tag-dot p-urgent">URGENTE</span>
95
+ <span class="tag-dot sp sp-vipcar">VIPCAR</span>
96
+
97
+ <div class="stat">
98
+ <div class="stat-head">
99
+ <span class="stat-label">CONCLUÍDAS · SEMANA</span>
100
+ <span class="stat-icon green">✓</span>
101
+ </div>
102
+ <div class="stat-value">8</div>
103
+ <div class="stat-sub">+18% vs anterior</div>
104
+ </div>
105
+ ```
106
+
107
+ 3. Veja `html/index.html` (exemplo prático) e `html/showcase.html` (galeria completa).
108
+
109
+ ---
110
+
111
+ ## Como usar — React (JSX)
112
+
113
+ 1. Copie a pasta `jsx/` pro seu projeto OU configure como pacote local.
114
+
115
+ 2. No entry-point (`main.jsx` / `App.jsx`):
116
+
117
+ ```jsx
118
+ import './path/to/jsx/tokens.css';
119
+ import './path/to/jsx/components.css';
120
+ ```
121
+
122
+ 3. Carregue as fontes (uma vez no `index.html` ou via `@import` no CSS).
123
+
124
+ 4. Importe componentes:
125
+
126
+ ```jsx
127
+ import { Button, TagDot, StatCard, Icons } from './path/to/jsx';
128
+
129
+ function Dashboard() {
130
+ return (
131
+ <>
132
+ <Button variant="primary" icon={<Icons.Plus size={14}/>}>
133
+ Nova Tarefa
134
+ </Button>
135
+
136
+ <TagDot kind="status" value="todo">A FAZER</TagDot>
137
+ <TagDot kind="priority" value="urgent">URGENTE</TagDot>
138
+ <TagDot kind="space" value="vipcar">VIPCAR</TagDot>
139
+
140
+ <StatCard
141
+ label="CONCLUÍDAS · SEMANA"
142
+ value="8"
143
+ sub="+18% vs anterior"
144
+ iconColor="green"
145
+ icon={<Icons.Check size={14}/>}
146
+ />
147
+ </>
148
+ );
149
+ }
150
+ ```
151
+
152
+ 5. Veja `jsx/App.example.jsx` para o exemplo completo (sidebar + dashboard + kanban + modal).
153
+
154
+ ---
155
+
156
+ ## Catálogo de componentes
157
+
158
+ ### Primitivos
159
+ | Componente | HTML class | JSX |
160
+ |------------|-----------|-----|
161
+ | Button | `.btn .btn-{variant} .btn-{size}` | `<Button variant size icon iconRight loading>` |
162
+ | Input | `.input .input-{size}` | `<Input size icon suffix mono invalid/>` |
163
+ | UrlInputFull | `.url-input-full` | `<UrlInputFull scheme placeholder/>` |
164
+ | Tag | `.tag .tag-{tone} .tag-{size}` | `<Tag tone size square>` |
165
+ | TagDot | `.tag-dot .{prefix}-{value}` | `<TagDot kind value>` |
166
+ | Badge | `.badge` | `<Badge count tone/>` |
167
+ | Toggle | `.toggle .toggle-sm .on` | `<Toggle on onChange size/>` |
168
+ | Segmented | `.segmented` | `<Segmented items value onChange/>` |
169
+ | Chips | `.chips .chip .active` | `<Chips items value onChange/>` |
170
+ | Avatar | `.avatar .avatar-sq` | `<Avatar name size color square src/>` |
171
+ | AvatarSpace| `.av-space` | `<AvatarSpace name spaceKey size/>` |
172
+ | Kbd | `.kbd` | `<Kbd>⌘K</Kbd>` |
173
+
174
+ ### App Patterns (derivados do CRM)
175
+ | Componente | HTML class | JSX |
176
+ |------------|-----------|-----|
177
+ | StatCard | `.stat .is-critical` | `<StatCard label value sub icon iconColor progress critical/>` |
178
+ | AlertCritical | `.alert-critical` | `<AlertCritical title items footer onItemClick/>` |
179
+ | Funnel | `.funnel .funnel-stages` | `<Funnel stages={[]}/>` |
180
+ | ProgressBar | `.stat-progress` | `<ProgressBar value tone/>` |
181
+ | KanbanColumn | `.k-col .k-col-head .k-add` | `<KanbanColumn title count dotColor onAddClick/>` |
182
+ | LeadCard | `.lead-card .is-paused .is-overdue` | `<LeadCard name company status hot channels time followUp indicator paused overdue/>` |
183
+ | EmptyState | `.empty-state` | `<EmptyState icon text action/>` |
184
+ | TableActions | `.t-actions .t-act` | `<TableActions onConfirm onEdit onDelete/>` |
185
+
186
+ ### Layout
187
+ | Componente | HTML class | JSX |
188
+ |------------|-----------|-----|
189
+ | Sidebar | `.zk-sidebar .zk-sidebar-link` | `<Sidebar logo footer/>` + `<SidebarLink active icon shortcut/>` + `<SidebarSection/>` |
190
+ | Panel | `.panel .panel-head .panel-body` | `<Panel title kicker flush/>` |
191
+ | Section | `.section .eyebrow` + h2 | `<Section eyebrow title description id/>` |
192
+ | Modal | `.modal-overlay .modal` | `<Modal open onClose title description footer/>` |
193
+ | Toast | `.toast .toast-success .toast-danger` | `<Toast tone icon/>` |
194
+ | Announce | `.announce` | `<Announce/>` |
195
+ | Tip | `.tip` | `<Tip eyebrow title desc icon onClose/>` |
196
+ | CodeBlock | `.code-block` | `<CodeBlock code onCopy onPreview/>` |
197
+ | Spec | `.spec` | `<Spec label value/>` |
198
+
199
+ ### Ícones (35)
200
+ 35 ícones outline em `Icons.{Name}`. Veja `jsx/icons.jsx` ou abra `html/showcase.html` (seção 26) para a galeria visual.
201
+
202
+ ---
203
+
204
+ ## Tokens essenciais
205
+
206
+ ### Status (tag-dot prefixo `s-`)
207
+ - `s-todo`, `s-progress`, `s-review`, `s-done`, `s-canceled`
208
+ - Modificadores: `s-overdue`, `s-paused`, `s-followup`
209
+
210
+ ### Prioridade (`p-`)
211
+ - `p-urgent`, `p-high`, `p-med`, `p-low`
212
+
213
+ ### Espaços/Clientes (`sp sp-{key}`)
214
+ - `sp-zark`, `sp-allsec`, `sp-vipcar`, `sp-limppe`, `sp-gerais`, `sp-mixshop`, `sp-vipseg`
215
+
216
+ ### Cores semânticas
217
+ - `--success-500` (verde), `--warning-500` (amarelo), `--danger-500` (vermelho), `--info-500` (azul)
218
+
219
+ ### Espaçamento (4px base)
220
+ - `--sp-4` (8px), `--sp-8` (16px), `--sp-12` (24px), `--sp-16` (32px), `--sp-20` (40px)
221
+
222
+ ### Raios (sem pill — Jordan-approved)
223
+ - `--r-xs` (3px), `--r-sm` (4px), `--r-md` (6px), `--r-lg` (8px), `--r-xl` (12px), `--r-2xl` (16px), `--r-3xl` (20px)
224
+
225
+ ---
226
+
227
+ ## Dark mode
228
+
229
+ Toggle automático via OS, ou manual:
230
+ ```js
231
+ document.documentElement.dataset.theme = 'dark'; // força dark
232
+ document.documentElement.dataset.theme = 'light'; // força light
233
+ delete document.documentElement.dataset.theme; // segue OS
234
+ ```
235
+
236
+ A cor de marca (`--ember-500`) **NUNCA muda no dark mode** — é assinatura ZARK. Apenas neutros, semânticos suaves e sombras ajustam.
237
+
238
+ ---
239
+
240
+ ## Regras importantes (NÃO fazer)
241
+
242
+ - ❌ Trocar `--ember-500` por outra cor.
243
+ - ❌ Hardcode de hex (`#f56f10` no código). SEMPRE use `var(--ember-500)`.
244
+ - ❌ Sombras frias (`rgba(0,0,0,...)`). Use as warm `rgba(20,17,12,...)`.
245
+ - ❌ `border-radius: 999px` ou `--r-pill`. Pill foi removido v3.
246
+ - ❌ Display font (Space Grotesk) em UI body — só títulos h1/h2/h3, modal titles, brand.
247
+ - ❌ Inter em títulos — display font é Space Grotesk.
248
+ - ❌ Animação > 280ms em microinterações.
249
+ - ❌ Brand color como bg dominante de tela inteira.
250
+
251
+ ---
252
+
253
+ ## Showcase
254
+
255
+ Para ver TUDO renderizado em uma página interativa, abra:
256
+ ```
257
+ html/showcase.html
258
+ ```
259
+
260
+ Tem light/dark toggle, todos os componentes, toda a paleta, todos os ícones — pronto pra inspecionar e copiar.
261
+
262
+ ---
263
+
264
+ *Mantido por @renankennedy · ZARK · 2026*