@snksergio/design-system 0.61.0 → 0.62.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/dist-lib/ai/componentes/AlertModal.md +47 -0
- package/dist-lib/ai/componentes/AppShell.md +117 -0
- package/dist-lib/ai/componentes/Breadcrumb.md +187 -0
- package/dist-lib/ai/componentes/Button.md +116 -0
- package/dist-lib/ai/componentes/ButtonGroup.md +162 -0
- package/dist-lib/ai/componentes/CardCheckbox.md +99 -0
- package/dist-lib/ai/componentes/CardOption.md +133 -0
- package/dist-lib/ai/componentes/Chart.md +93 -0
- package/dist-lib/ai/componentes/Chip.md +68 -0
- package/dist-lib/ai/componentes/ChoroplethMap.md +118 -0
- package/dist-lib/ai/componentes/ColorPicker.md +70 -0
- package/dist-lib/ai/componentes/Combobox.md +51 -0
- package/dist-lib/ai/componentes/ConversationListItem.md +90 -0
- package/dist-lib/ai/componentes/DataList.md +111 -0
- package/dist-lib/ai/componentes/DataTable.md +867 -0
- package/dist-lib/ai/componentes/DatePicker.md +84 -0
- package/dist-lib/ai/componentes/DateSeparatorChip.md +59 -0
- package/dist-lib/ai/componentes/EmptyState.md +72 -0
- package/dist-lib/ai/componentes/FileUploadField.md +95 -0
- package/dist-lib/ai/componentes/FloatingPanel.md +118 -0
- package/dist-lib/ai/componentes/FooterTable.md +62 -0
- package/dist-lib/ai/componentes/FormField.md +110 -0
- package/dist-lib/ai/componentes/Gantt.md +552 -0
- package/dist-lib/ai/componentes/Header.md +98 -0
- package/dist-lib/ai/componentes/Icon.md +65 -0
- package/dist-lib/ai/componentes/Kanban.md +343 -0
- package/dist-lib/ai/componentes/Kpi.md +103 -0
- package/dist-lib/ai/componentes/List.md +61 -0
- package/dist-lib/ai/componentes/MarkdownText.md +59 -0
- package/dist-lib/ai/componentes/MenuSidebar.md +128 -0
- package/dist-lib/ai/componentes/MessageAck.md +53 -0
- package/dist-lib/ai/componentes/MessageBubble.md +115 -0
- package/dist-lib/ai/componentes/MessageComposer.md +80 -0
- package/dist-lib/ai/componentes/MessageVariablesPicker.md +104 -0
- package/dist-lib/ai/componentes/Modal.md +88 -0
- package/dist-lib/ai/componentes/MonthYearPicker.md +49 -0
- package/dist-lib/ai/componentes/PageHeader.md +129 -0
- package/dist-lib/ai/componentes/Panel.md +84 -0
- package/dist-lib/ai/componentes/Scheduler.md +421 -0
- package/dist-lib/ai/componentes/ScreenLoader.md +60 -0
- package/dist-lib/ai/componentes/SingleMenuSidebar.md +171 -0
- package/dist-lib/ai/componentes/Spinner.md +52 -0
- package/dist-lib/ai/componentes/Table.md +192 -0
- package/dist-lib/ai/componentes/TableToolbar.md +87 -0
- package/dist-lib/ai/componentes/TabsNavigation.md +152 -0
- package/dist-lib/ai/componentes/Toast.md +49 -0
- package/dist-lib/ai/componentes/_primitivos.md +74 -0
- package/dist-lib/ai/componentes/avatar-ig.md +181 -0
- package/dist-lib/ai/componentes/indice.json +49 -0
- package/dist-lib/ai/exemplos/dashboard/dashboard-brazil-map.ts +33 -0
- package/dist-lib/ai/exemplos/dashboard/dashboard-screen.tsx +1110 -0
- package/dist-lib/ai/exemplos/dashboard/index.ts +1 -0
- package/dist-lib/ai/global/componentes.md +217 -0
- package/dist-lib/ai/global/composicao.md +182 -0
- package/dist-lib/ai/indice.json +177 -0
- package/dist-lib/ai/lint/ds-lint-patterns.mjs +115 -0
- package/dist-lib/ai/manifest.json +16 -0
- package/dist-lib/ai/regras/design.md +88 -0
- package/dist-lib/ai/regras/temas.md +192 -0
- package/dist-lib/ai/regras-por-componente.json +103 -0
- package/dist-lib/ai/roteiros/dashboard/blueprint.md +47 -0
- package/dist-lib/ai/roteiros/dashboard/entrevista.md +62 -0
- package/dist-lib/ai/roteiros/dashboard/geracao.md +88 -0
- package/dist-lib/ai/roteiros/dashboard/roteiro.md +88 -0
- package/package.json +4 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
> **Nota de portabilidade.** Este roteiro foi extraído do pipeline do iGreen DS
|
|
2
|
+
> para Claude Code. Menções a slash command (`/ds-create-…`), a `.claude/` e a
|
|
3
|
+
> ferramentas daquele ambiente descrevem **como ele é acionado lá** — aqui o
|
|
4
|
+
> equivalente é carregar este roteiro pelo `indice.json`. O conteúdo de decisão
|
|
5
|
+
> (entrevista, blueprint, regras de composição) vale igual.
|
|
6
|
+
|
|
7
|
+
> **Modo submódulo (`ds-link`).** Existe `.claude/ds-config.json` com `"mode": "submodule"`?
|
|
8
|
+
> Então **NÃO rode `igreen:add`** — esse script não existe no seu projeto. Os componentes e
|
|
9
|
+
> exemplos já estão no disco em `<dsPath>/src`: importe pelo `importBase` do config
|
|
10
|
+
> (compostos) e pelo `primitivesBase` (primitivos shadcn), e **leia** o exemplo direto de
|
|
11
|
+
> `<dsPath>/src/examples/`.
|
|
12
|
+
|
|
13
|
+
# Dashboard Builder (consumidor) — Geração
|
|
14
|
+
|
|
15
|
+
Só após o gate aprovado. Abort-on-error.
|
|
16
|
+
|
|
17
|
+
## 1. Puxar + ler ANTES de montar (nunca de memória)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm run igreen:add -- example-dashboard kpi chart panel
|
|
21
|
+
# + data-table (se tabela embutida) / data-list (se lista embutida)
|
|
22
|
+
```
|
|
23
|
+
Ler `src/examples/dashboard/dashboard-screen.tsx` (referência runnable) + `Kpi/USAGE.md`
|
|
24
|
+
+ `Chart/USAGE.md`. Catálogo visual: **https://igreen-desingsystem-admin.vercel.app** (`#/dashboard-showcase`).
|
|
25
|
+
**Prefira adaptar o example-dashboard** a montar do zero.
|
|
26
|
+
|
|
27
|
+
## 2. Receitas canônicas (as 6 — resumo; o example-dashboard tem o código completo)
|
|
28
|
+
|
|
29
|
+
**Shell**: `<div className="flex flex-col h-full min-h-0 gap-gp-2xl">` + `PageHeader`
|
|
30
|
+
(actions = PeriodSelector) + rows.
|
|
31
|
+
|
|
32
|
+
**§1 KPI-group "Painel do Líder"** (faixa de KPIs rápidos):
|
|
33
|
+
```tsx
|
|
34
|
+
<KpiGroup columns={N} divided>
|
|
35
|
+
<Kpi label="..." value="..." icon={<Icon />} tone="success|brand|info|warning|danger|neutral"
|
|
36
|
+
hint="..." delta={<KpiDelta value="+34" signed />} />
|
|
37
|
+
</KpiGroup>
|
|
38
|
+
```
|
|
39
|
+
Tone colore SÓ o ícone (círculo `size-form-lg rounded-radius-full`); valor default (só KPI de
|
|
40
|
+
alerta ganha cor). `signed` deriva verde/vermelho + seta do sinal; use tom explícito quando
|
|
41
|
+
"subir" não é bom (tempo ↓ = success).
|
|
42
|
+
|
|
43
|
+
**§2 Chart-card**: SectionCard (`flex flex-col gap-gp-2xl p-pad-3xl bg-bg-surface border
|
|
44
|
+
border-border-subtle rounded-radius-xl shadow-sh-sm`) com head discreto (título `text-body-md
|
|
45
|
+
font-medium`, subtítulo `text-body-xs text-fg-muted`, gap `gap-gp-2xs` (2px)) + `<ChartContainer
|
|
46
|
+
className="h-[160px]">`. Cor só por token. Big-number liderando: `text-stat-lg
|
|
47
|
+
leading-none tabular-nums` (30px/bold — o preset existe; NÃO hardcode `text-[30px]`). Legenda/metric-row: ícone-**quadrado** `size-comp-xl rounded-radius-base`
|
|
48
|
+
+ label/sub + valor à direita, sob `border-t border-border-subtle`.
|
|
49
|
+
|
|
50
|
+
**§3 Fusão KPI+evolução / ranking** (linha rica): identidade (rank badge `size-comp-sm
|
|
51
|
+
rounded-radius-full` + nome) · mini-KPIs em colunas (`hidden sm:flex gap-gp-6xl`, cada = quadrado
|
|
52
|
+
`size-comp-lg rounded-radius-base` tonal + valor `text-body-md font-semibold tabular-nums` +
|
|
53
|
+
label `text-caption-sm text-fg-muted`) · bloco headline à direita `ml-auto shrink-0 border-l
|
|
54
|
+
border-border-subtle pl-gp-3xl` (valor `text-title-lg font-bold` + delta Chip `shape="rounded"`,
|
|
55
|
+
seta 180° se negativo + micro-label `uppercase tracking-[0.04em]`).
|
|
56
|
+
|
|
57
|
+
**§4 Card dividido em 2**: 1 surface SEM padding + `grid lg:grid-cols-2`; cada painel `p-pad-3xl`
|
|
58
|
+
com ColHead; divisor no **2º painel**: `border-t border-border-subtle ... lg:border-l lg:border-t-0`.
|
|
59
|
+
|
|
60
|
+
**§5 Tabela embutida** → delega ao `crud-builder`: ordem identidade → status → categóricos →
|
|
61
|
+
muted → moeda/data à direita (`align:"right" tabular-nums`); primário `isPrimary`+`minWidth`+
|
|
62
|
+
`font-medium`; status `Chip variant="soft" size="sm" shape="rounded"`; filtros nativos
|
|
63
|
+
pré-aplicados (`defaultViews`/`presetView`), sem form solto acima.
|
|
64
|
+
|
|
65
|
+
**§6 Lista/kanban embutida** → delega ao `list-builder`: linha1 título bold `body-md` + `·`
|
|
66
|
+
secundário muted · linha2 meta muted `caption-md` (lugar · pessoa · data) · status Chip soft pill ·
|
|
67
|
+
valor à direita fixo `font-semibold tabular-nums`. **Sem botão de ação na linha.**
|
|
68
|
+
|
|
69
|
+
## 3. Registro
|
|
70
|
+
Registrar a página no roteador do app (perguntar ao usuário onde/como). Página órfã = incompleto.
|
|
71
|
+
|
|
72
|
+
## 4. Sequência (abort-on-error)
|
|
73
|
+
1. `igreen:add` dos itens + ler o example-dashboard.
|
|
74
|
+
2. Montar seção por seção (as § acima; adaptar o exemplo).
|
|
75
|
+
3. Registrar rota.
|
|
76
|
+
4. `npx tsc --noEmit` → erro: corrigir e repetir.
|
|
77
|
+
5. (recomendado) rodar o app e conferir: KPI-group divided, gráficos com token, ranking com
|
|
78
|
+
`border-l`, card dividido, tabela/lista embutida, responsivo + dark.
|
|
79
|
+
|
|
80
|
+
## 5. Checklist final
|
|
81
|
+
- [ ] Compõe 2+ tipos de seção espelhando o example-dashboard
|
|
82
|
+
- [ ] KPI-group divided + KpiDelta (signed só onde cabe); ícone círculo vs quadrado certo
|
|
83
|
+
- [ ] Gráficos só com token; tabela/lista via crud/list-builder
|
|
84
|
+
- [ ] Zero Tailwind literal com equivalente DS · zero hardcode
|
|
85
|
+
- [ ] Registro completo · `npx tsc --noEmit` limpo
|
|
86
|
+
|
|
87
|
+
## Handoff
|
|
88
|
+
`DASHBOARD_PRONTO: <Painel>` (+ onde foi registrada)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
> **Nota de portabilidade.** Este roteiro foi extraído do pipeline do iGreen DS
|
|
2
|
+
> para Claude Code. Menções a slash command (`/ds-create-…`), a `.claude/` e a
|
|
3
|
+
> ferramentas daquele ambiente descrevem **como ele é acionado lá** — aqui o
|
|
4
|
+
> equivalente é carregar este roteiro pelo `indice.json`. O conteúdo de decisão
|
|
5
|
+
> (entrevista, blueprint, regras de composição) vale igual.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Dashboard Builder (consumidor) — Router
|
|
9
|
+
|
|
10
|
+
Você guia a criação de uma tela de **dashboard/painel** que **compõe** os primitivos
|
|
11
|
+
do DS (`Kpi`/`KpiGroup`/`KpiDelta`, `Chart`, `Panel`, `DataTable`, `DataList`) nos
|
|
12
|
+
**padrões canônicos**. NÃO inventa API, NÃO gera de memória, NÃO toca em arquivo
|
|
13
|
+
antes do gate.
|
|
14
|
+
|
|
15
|
+
> Irmão do `crud-builder` (tabela) e do `list-builder` (lista). Dashboard não é um
|
|
16
|
+
> componente — é **composição** de seções. Uma tabela/lista DENTRO do dashboard é
|
|
17
|
+
> delegada ao crud/list-builder.
|
|
18
|
+
|
|
19
|
+
## ⚠️ Desambiguação ANTES de tudo
|
|
20
|
+
|
|
21
|
+
| Dashboard (ESTA skill) | Não é dashboard |
|
|
22
|
+
|---|---|
|
|
23
|
+
| **compõe** 2+ tipos de seção: KPIs + gráfico(s) + ranking/resumo numa "visão geral" | 1 tabela densa → `crud-builder` |
|
|
24
|
+
| foco em métrica/tendência/comparação, pouca edição | 1 lista de cards standalone → `list-builder` |
|
|
25
|
+
| ex: painel do líder, resumo de categoria, visão da rede | 1 gráfico isolado → skill `charts` |
|
|
26
|
+
|
|
27
|
+
Só 1 grade/lista/gráfico → **PARAR** e rotear pro builder certo.
|
|
28
|
+
|
|
29
|
+
## Ambiente (projeto CONSUMIDOR, copy-in)
|
|
30
|
+
|
|
31
|
+
| Variável | Valor |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `IMPORT_PATH` | `@/components/ui/Kpi`, `@/components/ui/Chart`, `@/components/ui/Panel`, etc (copy-in via alias) |
|
|
34
|
+
| `EXEMPLO_CANÔNICO` | `example-dashboard` → `npm run igreen:add -- example-dashboard` → ler `src/examples/dashboard/dashboard-screen.tsx` |
|
|
35
|
+
| `DOC` | `src/components/ui/Kpi/USAGE.md` + `Chart/USAGE.md` (após `igreen:add`) + types ao lado; catálogo visual hospedado `#/dashboard-showcase` |
|
|
36
|
+
| `PAGES_DIR` / `REGISTRO` | perguntar ao usuário (onde mora a página + como registra rota) |
|
|
37
|
+
|
|
38
|
+
Se o componente/exemplo não está no disco, **puxe via `igreen:add`** antes de ler.
|
|
39
|
+
|
|
40
|
+
> **Modo submódulo (ds-link).** Se existe `.claude/ds-config.json` com `"mode": "submodule"`,
|
|
41
|
+
> o DS é consumido como **submódulo** (não copy-in): os componentes/exemplos JÁ estão no disco
|
|
42
|
+
> em `<dsPath>/src` e **não** há registry. Use `importBase` do config (ex.: `@ds/components/ui/<Nome>`)
|
|
43
|
+
> e leia o exemplo canônico direto em `<dsPath>/src/examples/dashboard/dashboard-screen.tsx` —
|
|
44
|
+
> **NÃO** rode `igreen:add`. `PAGES_DIR`/`REGISTRO` continuam do projeto pai.
|
|
45
|
+
|
|
46
|
+
## Fluxo — 3 estágios
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
/ds-create-dashboard
|
|
50
|
+
▼ interview.md
|
|
51
|
+
1. ENTREVISTA (fases 0-6) — KPIs → gráficos → ranking/fusão → dividido/mapa → tabela/lista → layout; ZERO edição
|
|
52
|
+
▼ blueprint.md
|
|
53
|
+
2. BLUEPRINT [GATE] — mapa de rows + pré-validações → aguarda "aprovar"
|
|
54
|
+
▼ generate.md
|
|
55
|
+
3. GERAÇÃO — igreen:add example-dashboard → ler → montar → registrar → tsc → handoff
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Carregue cada sub-arquivo só no estágio: `interview.md` agora, `blueprint.md` ao fim
|
|
59
|
+
da entrevista, `generate.md` só após o gate.
|
|
60
|
+
|
|
61
|
+
## ⚠️ Precedência de fontes (anti-drift)
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
1. src/examples/dashboard/dashboard-screen.tsx (exemplo real — vence tudo)
|
|
65
|
+
2. src/components/ui/Kpi/USAGE.md + Chart/USAGE.md + types ao lado
|
|
66
|
+
3. Snippets/receitas desta skill (generate.md)
|
|
67
|
+
4. Memória da IA ← NUNCA confiar sozinha
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Guardrails (não-negociáveis)
|
|
71
|
+
|
|
72
|
+
1. LER `example-dashboard` ANTES de montar — nunca de memória.
|
|
73
|
+
2. **KPI rápido = "Painel do Líder"**: `<KpiGroup divided>` + `<Kpi>` + `<KpiDelta>`.
|
|
74
|
+
Tone colore SÓ o ícone (círculo); valor default (só KPI de alerta ganha cor).
|
|
75
|
+
Delta: `signed` só quando sinal = bom/ruim; senão `tone` explícito ("-12s" é melhora → success).
|
|
76
|
+
3. Gráfico = SEMPRE `<ChartContainer>`, cor só por token (`--color-chart-1..5`); ver skill `charts`.
|
|
77
|
+
4. Ranking/fusão + card dividido: divisor via `border-l`/`border-t` (nunca só gap);
|
|
78
|
+
ícone mini-stat = **quadrado** `size-comp-lg rounded-radius-base`, KPI-group = **círculo** `size-form-lg rounded-radius-full`.
|
|
79
|
+
5. Tabela/lista embutida → delegar a `crud-builder`/`list-builder`; filtros nativos pré-aplicados, sem form solto acima.
|
|
80
|
+
6. Classes DS antes de Tailwind literal; zero hardcode (ver `.claude/rules/ds-design.md`, `DESIGN.md`). Números grandes literais só onde não há preset.
|
|
81
|
+
7. Shell: `flex flex-col h-full min-h-0 gap-gp-2xl` (PageHeader → 16px → rows). Estreito → 1 card/row.
|
|
82
|
+
8. Página registrada no roteador do usuário — órfã = incompleto.
|
|
83
|
+
9. `npx tsc --noEmit` limpo antes do handoff.
|
|
84
|
+
|
|
85
|
+
## Handoff
|
|
86
|
+
|
|
87
|
+
- Entrevista pronta → `BLUEPRINT_PRONTO: <Painel> (dashboard) — aguardando gate`
|
|
88
|
+
- Pós-geração → `DASHBOARD_PRONTO: <Painel>` (+ onde foi registrada)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snksergio/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0",
|
|
4
4
|
"//distribuicao": "Canal PRIMARIO = registry shadcn (copy-in) + CLI @snksergio/create-design-system; sobe sozinho no merge (Vercel). Canal SECUNDARIO = este pacote npm (@snksergio/design-system), publicado por passo MANUAL do mantenedor, entao costuma ficar atras do registry. SECUNDARIO descreve a ORDEM DE PUBLICACAO, nao o nivel de suporte: NAO e depreciado, e desde a 0.37.0 entrega 41 dos 42 componentes ui/ no barrel raiz + os 41 primitivos shadcn no subpath ./shadcn (so TabelaTeste, demo interno, fica de fora). Publish so pelo Passo 7 do .claude/skills/ds-dev/release.md (valida com `npm run lib:verify`, pede o token, publica, revoga). Ver DISTRIBUICAO.md.",
|
|
5
5
|
"description": "iGreen Design System — internal library for SaaS CRM, admin panels and dashboards. React 19 + Tailwind v4 + Shadcn + Radix.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
"dist-lib/chunks/**",
|
|
20
20
|
"dist-lib/src/**",
|
|
21
21
|
"dist-lib/tokens/**",
|
|
22
|
+
"dist-lib/ai/**",
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
25
|
+
"//ai-bundle": "dist-lib/ai/ é o pacote de conteúdo pra IA fora do Claude Code (roteiros, regras, exemplos, guias, manifesto com versão+commit). É LIDO POR CAMINHO, não importado — por isso só o manifest.json tem entrada em exports, como âncora resolvível e verificada pelo lib-verify; os outros 60+ arquivos seguem o precedente de dist-lib/fonts/**, que está em files sem export e o gate aprova. Enumerar 60 markdowns em exports seria ruído, e wildcard não é verificado (ver //exports-theme-marcas). Gerado no closeBundle do vite.lib.config.ts.",
|
|
24
26
|
"engines": {
|
|
25
27
|
"node": ">=20.0.0"
|
|
26
28
|
},
|
|
@@ -44,6 +46,7 @@
|
|
|
44
46
|
"import": "./dist-lib/shadcn.mjs",
|
|
45
47
|
"require": "./dist-lib/shadcn.cjs"
|
|
46
48
|
},
|
|
49
|
+
"./ai/manifest.json": "./dist-lib/ai/manifest.json",
|
|
47
50
|
"./theme.css": "./dist-lib/theme.css",
|
|
48
51
|
"./theme/brand-blue.css": "./dist-lib/theme/brand-blue.css",
|
|
49
52
|
"./theme/brand-green.css": "./dist-lib/theme/brand-green.css",
|