<Form size="xs"> renderizaba acciones md: la talla moria en el provider (form-submit/reset con default 'md', nada la propagaba) y del eje entero solo sobrevivia el row-gap. Contexto de eidos calcado 1:1 de toolbar/context.ts (el precedente A-112): form provee su size resuelto; Submit/Reset lo consumen como default (su prop explicita gana; md standalone). El eje va VERBATIM, no tapado en md - la bifurcacion de doctrina queda RESUELTA Y ESCRITA (next-features 13 "Anchura vs densidad"): reference.md:590 (tapar en md, precedente Dialog.Close) gobierna ejes de ANCHURA; el de form es DENSIDAD declarada cuya receta ya escribio los cinco peldanos. - 5 ficheros de codigo, solo eidos (context.ts NUEVO); los dos costes avisados NO se tocan, verificado con linea: la excepcion A11 de form-auto-fields y el duck type CompatibleFormProvider quedan intactos (el puente es setContext/getContext con Simbolo propio, disjunto). - Medido: 84 diffs y NI UNO fuera - submit 40, reset 40, form 4 (su panel); CERO en array/widget/error-summary; CERO en md. Alto -10/-6/0/+8/+16 px; la letra lg/xl difiere de la prediccion (+4/+12 vs +2/+8) por causa MEDIDA: --font-size-lg/xl son clamp() fluidos que saturan desde ~1200px - ningun valor fuera de la escalera. Capturas xs/md/xl revisadas por el supervisor. - Los botones del array siguen POR HERENCIA CSS, intactos (0 diffs) - respuesta para E1: E2 ahorra el contexto, no la lectura (E1 debera pasar size al Button que inyecte o sigue siendo la regresion medida). - Dos mentiras NUEVAS del instrumento, registradas: la sonda estandar fuerza data-size sobre el nodo compuesto y SE PISA (su 0 es por construccion) - y los clamp() fluidos no son comparables sin declarar viewport. - Registro: 13 cierra E2 (diagnostico original conservado tachado - era exacto) y abre alert-dialog (mismo agujero; a el le toca la norma TAPADA por ser eje de anchura), error-summary con data-size que nadie lee, la escalera de fuente 3-sobre-5 que viola el 1:1 (E1, su carril), y la cita colgada de dialog/context.ts:9. Pendiente dicho: el parrafo de doctrina querria vivir tambien en reference.md (fuera del alcance liberado). - Gates: eidos 443+1 ajeno - check 0 atribuibles - docs-check 0/0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>alpha-0.1-background
parent
3bf7930baa
commit
318aac207d
@ -0,0 +1,39 @@
|
||||
import { getContext, setContext } from 'svelte';
|
||||
import type { FormSize } from './types';
|
||||
|
||||
/**
|
||||
* Eidos context published by `<Form>` and read by `<Form.Submit>` / `<Form.Reset>`.
|
||||
*
|
||||
* It carries the form's resolved `size` so the composed canon `<Button>`
|
||||
* defaults to the form's density instead of Button's own `md`. Same shape and
|
||||
* rationale as Toolbar's context: Button's recipe reads `data-size` ON the
|
||||
* button element, so a descendant selector on the form can't reach it — the
|
||||
* child must carry the attr itself, and the context lets it inherit the form's
|
||||
* value while an explicit prop on the action always wins.
|
||||
*
|
||||
* VERBATIM, not capped at `md`. The `md` cap of
|
||||
* `docs/theming/reference.md` §"Container→part derivation" governs a container
|
||||
* whose size axis is WIDTH (its first consumer is `Dialog.Close`: a wider — or
|
||||
* `full` — dialog must not fatten its controls). A form's axis is declared
|
||||
* DENSITY (`types.ts`: "Visual density for form spacing and action controls")
|
||||
* and its own recipe already wrote the five distinct steps of
|
||||
* `--_form-action-height` / `-padding-inline` / `-font-size`, xs..xl. A recipe
|
||||
* that ladders its action across five steps is not capping at `md`.
|
||||
*
|
||||
* A property getter keeps the bridge reactive: when the form's `size` prop
|
||||
* changes, every action re-reads on its next derivation.
|
||||
*/
|
||||
|
||||
const KEY = Symbol('form-eidos-ctx');
|
||||
|
||||
export interface FormEidosCtx {
|
||||
readonly size: FormSize;
|
||||
}
|
||||
|
||||
export function setFormEidosCtx(ctx: FormEidosCtx): void {
|
||||
setContext(KEY, ctx);
|
||||
}
|
||||
|
||||
export function getFormEidosCtx(): FormEidosCtx | undefined {
|
||||
return getContext<FormEidosCtx | undefined>(KEY);
|
||||
}
|
||||
Loading…
Reference in new issue