@kenlo/kdls-design-system 2.0.5 → 2.6.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/README.md +21 -1
- package/dist/components/Table/Table.d.ts +14 -0
- package/dist/index.cjs +3 -3
- package/dist/index.css +1 -1
- package/dist/index.js +2216 -2147
- package/kdls-manifest.json +7098 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -11,9 +11,29 @@ kdls-design-system/
|
|
|
11
11
|
├── portal/ # app de documentação interativa (playgrounds)
|
|
12
12
|
├── docs/ # PATTERNS.md (receitas de UI)
|
|
13
13
|
├── .claude/ # CLAUDE.md (índice), component-rules.md, component-standard.md, tokens-reference.md (regras)
|
|
14
|
-
└── scripts/ # geradores (ex.: styles.css)
|
|
14
|
+
└── scripts/ # geradores (ex.: styles.css, kdls-manifest.json)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
## Manifesto — o catálogo que as máquinas leem
|
|
18
|
+
|
|
19
|
+
`kdls-manifest.json` descreve este design system num arquivo só: os 55 componentes, as
|
|
20
|
+
696 props com tipo, padrão, descrição e exemplo, os 381 tokens, e a linha de import exata
|
|
21
|
+
de cada símbolo (`import type` quando é um tipo, e não um componente).
|
|
22
|
+
|
|
23
|
+
**É gerado, nunca escrito à mão** — `npm run gen:manifest`, a partir das mesmas fontes que
|
|
24
|
+
uma pessoa lê: `components/`, `portal/src/playground-utils/props-tables.ts`,
|
|
25
|
+
`foundations/tokens.css` e o `package.json`. A esteira roda `--check` em toda merge
|
|
26
|
+
request: se alguém mexer numa prop e não regenerar, o pipeline reprova. Um catálogo
|
|
27
|
+
desatualizado é pior que nenhum — ele responde errado com a mesma confiança.
|
|
28
|
+
|
|
29
|
+
Serve para o Kenlo Brain responder "preciso de um seletor de data" com o componente, as
|
|
30
|
+
props e a linha de import, em vez de um resultado de busca. Está no pacote npm
|
|
31
|
+
(`@kenlo/kdls-design-system/manifest.json`) e publicado junto do portal, onde pode ser
|
|
32
|
+
lido sem credencial nenhuma.
|
|
33
|
+
|
|
34
|
+
O manifesto também reporta a própria defasagem, no campo `drift`: componentes sem tabela
|
|
35
|
+
de props (invisíveis para uma máquina) e tabelas sem componente correspondente.
|
|
36
|
+
|
|
17
37
|
## Tokens
|
|
18
38
|
|
|
19
39
|
Os tokens ficam em `foundations/tokens.css` como CSS custom properties (`var(--spacing-4)`, `var(--color-primary-50)`), com auto-inversão light/dark. Escala de espaçamento em múltiplos de 4px. Catálogo completo em [`.claude/tokens-reference.md`](.claude/tokens-reference.md).
|
|
@@ -19,6 +19,13 @@ export interface TableColumn<T = Record<string, unknown>> {
|
|
|
19
19
|
ellipsis?: boolean;
|
|
20
20
|
/** true = sortable, sorting done by the backend (the component only reports state via onSortChange, doesn't reorder `rows`) · function = sorts on the frontend using this comparator — handle dates and numbers inside it, don't let the component guess the type */
|
|
21
21
|
sortable?: boolean | ((a: T, b: T) => number);
|
|
22
|
+
/**
|
|
23
|
+
* Marks this column as a mobile-only action slot — has no effect above the mobile
|
|
24
|
+
* breakpoint. `'link'` pulls it out of the stack into a final row shared with any other
|
|
25
|
+
* `'link'` columns (one button: left-aligned; more than one: split evenly). `'icon'`
|
|
26
|
+
* (e.g. a chevron or a ••• menu) pins it to the row's top-right corner instead.
|
|
27
|
+
*/
|
|
28
|
+
mobileAction?: 'link' | 'icon';
|
|
22
29
|
/** Custom cell rendering — when omitted, displays row[key] directly */
|
|
23
30
|
render?: (value: unknown, row: T, index: number) => React.ReactNode;
|
|
24
31
|
}
|
|
@@ -31,6 +38,13 @@ export interface TableProps<T extends Record<string, unknown> = Record<string, u
|
|
|
31
38
|
columns: TableColumn<T>[];
|
|
32
39
|
/** Row data */
|
|
33
40
|
rows: T[];
|
|
41
|
+
/**
|
|
42
|
+
* Layout of the table. `'default'` is a flush list — rows have no radius, no gap
|
|
43
|
+
* between them, divided by a top border only. `'cardLines'` keeps each row as an
|
|
44
|
+
* individual card instead (own border, radius, gap, plus the container's own padding).
|
|
45
|
+
* Background, the theme's radius and the bordered stroke behave the same in both.
|
|
46
|
+
*/
|
|
47
|
+
variant?: 'default' | 'cardLines';
|
|
34
48
|
/**
|
|
35
49
|
* Shows a 1px neutral-20 border around the component. `false` by default.
|
|
36
50
|
* Use `true` when the surrounding background matches the Table's background (--color-neutral-00) —
|