You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
12 KiB
156 lines
12 KiB
# tree-view — alcance de tema: análisis y propuesta
|
|
|
|
> Generado por `node --import tsx/esm scripts/theming-census.ts --report`.
|
|
> Lo **medido** y la **propuesta** se regeneran; el **Veredicto** (§5) se conserva.
|
|
> Vista de conjunto: [README](./README.md) · método y protocolo:
|
|
> [`PLAN-theming.md`](../../process/PLAN-theming.md) §1, §2, §7.
|
|
|
|
- **Medido**: 2026-08-20 · **Alcance**: **0%** — 0 de 26 knobs por token público
|
|
- **Knobs de apariencia**: 28 — público 0 · privado 8 · global 14 · literal 4 · sistema 2 _(fuera del ratio)_
|
|
- **Contrato hoy** (`lib/recipes/base.ts`): 0 pública(s) · 1 privada(s) forward — `_palette-element`
|
|
- **Eje `size`**: sí · **ficheros**: `tree-view.css`
|
|
|
|
## 1. Knobs fuera de alcance
|
|
|
|
### 1.1 Directo a primitivo global (14)
|
|
|
|
| # | fichero:línea | selector | propiedad | valor |
|
|
| ---: | --- | --- | --- | --- |
|
|
| 1 | `tree-view.css:34` | `[data-tree-view-root]` | `font-family` | `var(--style-label-font-family)` |
|
|
| 2 | `tree-view.css:36` | `[data-tree-view-root]` | `line-height` | `var(--leading-ui)` |
|
|
| 3 | `tree-view.css:37` | `[data-tree-view-root]` | `color` | `var(--color-content-primary)` |
|
|
| 4 | `tree-view.css:47` | `[data-tree-view-root][data-variant='surface']` | `border` | `var(--border-width) solid var(--color-border-default)` |
|
|
| 5 | `tree-view.css:48` | `[data-tree-view-root][data-variant='surface']` | `background` | `var(--color-surface-default)` |
|
|
| 6 | `tree-view.css:49` | `[data-tree-view-root][data-variant='surface']` | `padding` | `var(--space-2)` |
|
|
| 7 | `tree-view.css:53` | `[data-tree-view-root][data-variant='outline']` | `border` | `var(--border-width) solid var(--color-border-default)` |
|
|
| 8 | `tree-view.css:55` | `[data-tree-view-root][data-variant='outline']` | `padding` | `var(--space-2)` |
|
|
| 9 | `tree-view.css:59` | `[data-tree-view-root][data-variant='ghost']` | `border` | `var(--border-width) solid transparent` |
|
|
| 10 | `tree-view.css:121` | `[data-tree-view-branch-control], [data-tree-view-item]` | `gap` | `var(--space-2)` |
|
|
| 11 | `tree-view.css:128` | `[data-tree-view-branch-control], [data-tree-view-item]` | `border-radius` | `var(--radius-sm)` |
|
|
| 12 | `tree-view.css:137` | `[data-tree-view-branch-control]:hover:not([data-disabled]), [data-tree-view-item]:hover:not([data-disabled])` | `background` | `var(--color-surface-overlay)` |
|
|
| 13 | `tree-view.css:147` | `[data-tree-view-branch-control][data-disabled], [data-tree-view-item][data-disabled]` | `color` | `var(--color-content-muted)` |
|
|
| 14 | `tree-view.css:166` | `[data-tree-view-branch-indicator]` | `color` | `var(--color-content-secondary)` |
|
|
|
|
### 1.2 A través de un privado (8)
|
|
|
|
| # | fichero:línea | selector | propiedad | valor |
|
|
| ---: | --- | --- | --- | --- |
|
|
| 1 | `tree-view.css:33` | `[data-tree-view-root]` | `border-radius` | `var(--_tree-view-radius)` |
|
|
| 2 | `tree-view.css:35` | `[data-tree-view-root]` | `font-size` | `var(--_tree-view-font-size)` |
|
|
| 3 | `tree-view.css:122` | `[data-tree-view-branch-control], [data-tree-view-item]` | `min-block-size` | `var(--_tree-view-row-block-size)` |
|
|
| 4 | `tree-view.css:123` | `[data-tree-view-branch-control], [data-tree-view-item]` | `padding-block` | `var(--_tree-view-row-padding-block)` |
|
|
| 5 | `tree-view.css:124` | `[data-tree-view-branch-control], [data-tree-view-item]` | `padding-inline-end` | `var(--_tree-view-row-padding-inline)` |
|
|
| 6 | `tree-view.css:125` | `[data-tree-view-branch-control], [data-tree-view-item]` | `padding-inline-start` | `calc( var(--tree-depth, 0) * var(--_tree-view-indent) + var(--_tree-view-row-padding-inline) )` |
|
|
| 7 | `tree-view.css:142` | `[data-tree-view-branch-control][data-selected]:not([data-disabled]), [data-tree-view-item][data-selected]:not([data-disabled])` | `background` | `var(--_tree-view-palette-element)` |
|
|
| 8 | `tree-view.css:200` | `[data-tree-view-root][data-indent-guides] [data-tree-view-branch]::before` | `background` | `var(--_tree-view-guide)` |
|
|
|
|
### 1.3 Literales (4)
|
|
|
|
| # | fichero:línea | selector | propiedad | valor |
|
|
| ---: | --- | --- | --- | --- |
|
|
| 1 | `tree-view.css:42` | `[data-tree-view-root][data-block]` | `inline-size` | `100%` |
|
|
| 2 | `tree-view.css:164` | `[data-tree-view-branch-indicator]` | `inline-size` | `1em` |
|
|
| 3 | `tree-view.css:165` | `[data-tree-view-branch-indicator]` | `block-size` | `1em` |
|
|
| 4 | `tree-view.css:199` | `[data-tree-view-root][data-indent-guides] [data-tree-view-branch]::before` | `inline-size` | `1px` |
|
|
|
|
## 2. Sistema transversal (2) — informativo, fuera del ratio
|
|
|
|
Un tema los alcanza **a nivel de sistema**, por diseño (recipe-contract §2).
|
|
|
|
| # | fichero:línea | selector | propiedad | valor |
|
|
| ---: | --- | --- | --- | --- |
|
|
| 1 | `tree-view.css:149` | `[data-tree-view-branch-control][data-disabled], [data-tree-view-item][data-disabled]` | `opacity` | `var(--opacity-disabled)` |
|
|
| 2 | `tree-view.css:154` | `[data-tree-view-branch-control]:focus-visible, [data-tree-view-item]:focus-visible` | `outline` | `var(--focus-ring-width) solid var(--focus-ring-color)` |
|
|
|
|
## 3. Privados de la receta — ¿de dónde sale su valor?
|
|
|
|
| privado | declaraciones | valor(es) | origen | ¿deriva de un público? |
|
|
| --- | ---: | --- | --- | :-: |
|
|
| `--_tree-view-radius` | 1 | `var(--radius-md)` | global | no |
|
|
| `--_tree-view-row-block-size` | 5 | `var(--control-height-md)`, `var(--control-height-xs)`, `var(--control-height-sm)`, `var(--control-height-lg)`, `var(--control-height-xl)` | global | no |
|
|
| `--_tree-view-row-padding-block` | 2 | `var(--space-1)`, `0` | global, literal | no |
|
|
| `--_tree-view-row-padding-inline` | 5 | `var(--space-2)`, `var(--space-1)`, `var(--space-3)`, `var(--space-4)` | global | no |
|
|
| `--_tree-view-indent` | 5 | `var(--space-4)`, `var(--space-3)`, `var(--space-5)`, `var(--space-6)` | global | no |
|
|
| `--_tree-view-font-size` | 5 | `var(--font-size-sm)`, `var(--font-size-xs)`, `var(--font-size-md)`, `var(--font-size-lg)` | global | no |
|
|
| `--_tree-view-guide` | 1 | `var(--color-border-default)` | global | no |
|
|
|
|
Consumidos y **no declarados en el CSS** (vienen de `base.ts` o de un estilo inline del wrapper): `--_tree-view-palette-element`.
|
|
|
|
## 4. Propuesta de corrección
|
|
|
|
- **Tiene eje `size`**: los tokens dimensionales van por talla (`{part}-{eje}-{k}`) apuntando al bundle `--size-{k}-*`, nunca al primitivo crudo (theming §5; el guard `recipe-css-contract` prohíbe el primitivo).
|
|
|
|
### 4.1 Tokens a declarar en `lib/recipes/base.ts` (30)
|
|
|
|
Valor **verbatim** del CSS de hoy: el default no se mueve, sólo cambia quién
|
|
puede moverlo. Nombres derivados de recipe-contract §1 (ejes lógicos, talla
|
|
al final) y theming §6.7 (slots de color, modificador delante). Un token con
|
|
DOS valores distintos es una colisión de nombre: son dos knobs, o el nombre
|
|
no distingue lo que debería — se marca `⚠`.
|
|
|
|
| token (`--tree-view-…`) | scope TSC | valor propuesto | usos |
|
|
| --- | --- | --- | ---: |
|
|
| `branch-control-padding-block` | `root` | ⚠ `var(--space-1)` / `0` | 2 |
|
|
| `branch-control-padding-inline-md` | `size:md` | ⚠ `var(--space-2)` / `var(--space-4)` | 2 |
|
|
| `branch-control-padding-inline-xs` | `size:xs` | ⚠ `var(--space-1)` / `var(--space-3)` | 2 |
|
|
| `branch-control-padding-inline-sm` | `size:sm` | ⚠ `var(--space-2)` / `var(--space-3)` | 2 |
|
|
| `branch-control-padding-inline-lg` | `size:lg` | ⚠ `var(--space-3)` / `var(--space-5)` | 2 |
|
|
| `branch-control-padding-inline-xl` | `size:xl` | ⚠ `var(--space-4)` / `var(--space-6)` | 2 |
|
|
| `root-radius` | `root` | `var(--radius-md)` | 1 |
|
|
| `root-font-family` | `root` | `var(--style-label-font-family)` | 1 |
|
|
| `root-font-size-md` | `size:md` | `var(--font-size-sm)` | 1 |
|
|
| `root-font-size-xs` | `size:xs` | `var(--font-size-xs)` | 1 |
|
|
| `root-font-size-sm` | `size:sm` | `var(--font-size-sm)` | 1 |
|
|
| `root-font-size-lg` | `size:lg` | `var(--font-size-md)` | 1 |
|
|
| `root-font-size-xl` | `size:xl` | `var(--font-size-lg)` | 1 |
|
|
| `root-line-height` | `root` | `var(--leading-ui)` | 1 |
|
|
| `root-fg` | `root` | `var(--color-content-primary)` | 1 |
|
|
| `surface-root-bg` | `root` | `var(--color-surface-default)` | 1 |
|
|
| `branch-control-gap` | `root` | `var(--space-2)` | 1 |
|
|
| `branch-control-height-md` | `size:md` | `var(--control-height-md)` | 1 |
|
|
| `branch-control-height-xs` | `size:xs` | `var(--control-height-xs)` | 1 |
|
|
| `branch-control-height-sm` | `size:sm` | `var(--control-height-sm)` | 1 |
|
|
| `branch-control-height-lg` | `size:lg` | `var(--control-height-lg)` | 1 |
|
|
| `branch-control-height-xl` | `size:xl` | `var(--control-height-xl)` | 1 |
|
|
| `branch-control-radius` | `root` | `var(--radius-sm)` | 1 |
|
|
| `hover-branch-control-bg` | `root` | `var(--color-surface-overlay)` | 1 |
|
|
| `disabled-branch-control-fg` | `root` | `var(--color-content-muted)` | 1 |
|
|
| `branch-indicator-width` | `root` | `1em` | 1 |
|
|
| `branch-indicator-height` | `root` | `1em` | 1 |
|
|
| `branch-indicator-fg` | `root` | `var(--color-content-secondary)` | 1 |
|
|
| `root-width` | `root` | `1px` | 1 |
|
|
| `root-bg` | `root` | `var(--color-border-default)` | 1 |
|
|
|
|
### 4.2 Sin nombre mecánico (7)
|
|
|
|
- **⚠ decisión: `100%` es un valor identidad o geometría de layout, no un knob de tema — el perímetro de «knob» es D-TH.2, sin firmar** — 1: `inline-size`.
|
|
- **⚠ decisión: `border` es shorthand o eje físico — hay que partirlo en ejes lógicos antes de nombrarlo (recipe-contract §1, R-4.4)** — 3: `border`.
|
|
- **⚠ decisión: `padding` es shorthand o eje físico — hay que partirlo en ejes lógicos antes de nombrarlo (recipe-contract §1, R-4.4)** — 2: `padding`.
|
|
- **⚠ decisión: el privado que alimenta este knob no se declara en el CSS (viene de `base.ts` o de un estilo inline) — hay que resolverlo antes de nombrarlo** — 1: `background`.
|
|
|
|
### 4.3 Avisos sobre los tokens propuestos (7)
|
|
|
|
- **el privado `--_tree-view-radius` debe pasar a leer este público (o desaparecer)** — `--tree-view-root-radius`
|
|
- **el privado `--_tree-view-font-size` debe pasar a leer este público (o desaparecer)** — `--tree-view-root-font-size-md`, `--tree-view-root-font-size-xs`, `--tree-view-root-font-size-sm`, `--tree-view-root-font-size-lg`, `--tree-view-root-font-size-xl`
|
|
- **el privado `--_tree-view-row-block-size` debe pasar a leer este público (o desaparecer)** — `--tree-view-branch-control-height-md`, `--tree-view-branch-control-height-xs`, `--tree-view-branch-control-height-sm`, `--tree-view-branch-control-height-lg`, `--tree-view-branch-control-height-xl`
|
|
- **el privado `--_tree-view-row-padding-block` debe pasar a leer este público (o desaparecer)** — `--tree-view-branch-control-padding-block`
|
|
- **el privado `--_tree-view-row-padding-inline` debe pasar a leer este público (o desaparecer)** — `--tree-view-branch-control-padding-inline-md`, `--tree-view-branch-control-padding-inline-xs`, `--tree-view-branch-control-padding-inline-sm`, `--tree-view-branch-control-padding-inline-lg`, `--tree-view-branch-control-padding-inline-xl`
|
|
- **el privado `--_tree-view-indent` debe pasar a leer este público (o desaparecer)** — `--tree-view-branch-control-padding-inline-md`, `--tree-view-branch-control-padding-inline-xs`, `--tree-view-branch-control-padding-inline-sm`, `--tree-view-branch-control-padding-inline-lg`, `--tree-view-branch-control-padding-inline-xl`
|
|
- **el privado `--_tree-view-guide` debe pasar a leer este público (o desaparecer)** — `--tree-view-root-bg`
|
|
|
|
### 4.4 Lo que hay que comprobar a mano (PLAN-theming §1.3 · §7.4)
|
|
|
|
- [ ] **Privado que no deriva de un público** — §3 lo marca; el privado debe leer el público o desaparecer.
|
|
- [ ] **Velo o acento en el nodo equivocado** (`archetype: 'item'` en un envoltorio, un `background` en shorthand que mata la capa de estado) — se mide desde el píxel hacia arriba.
|
|
- [ ] **Doble animación** al mover un sello a una superficie con animación propia — registro de `animationstart`/`animationend`.
|
|
- [ ] **Diff de computed = 0** en reposo · hover · abierto · disabled · foco, por talla, antes y después.
|
|
- [ ] **Centinela por token nuevo**: valor imposible en el root → el nodo lo sigue. Si no, el token miente.
|
|
|
|
## 5. Veredicto
|
|
|
|
<!-- veredicto:start -->
|
|
|
|
_(pendiente — lo escribe el autor; se conserva al regenerar)_
|
|
|
|
<!-- veredicto:end -->
|