From 3ae9ff339a7e4ac55467571b4a58e472bd9266b3 Mon Sep 17 00:00:00 2001 From: dev Date: Mon, 22 Jun 2026 16:10:44 +0200 Subject: [PATCH] =?UTF-8?q?fix(eidos):=20--radius-default=20sm=20=E2=86=92?= =?UTF-8?q?=20md=20(radius=20archetype=20default)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reconsidered Decisión 2 against the reference systems: the default radius should equal the eidos control center-of-gravity (button / field / select-trigger = md / 6px), like Bootstrap / Chakra / Radix-medium. `sm` (4px) would leave the default tighter than the controls themselves — backwards — and would shrink any control that later adopts the token; md makes that adoption a no-op. `--radius-default` = var(--radius-md). Verified in-browser: resolves to 6px. check 0. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/uix/eidos/ARCHETYPE_COHERENCE_AUDIT_2026-06-19.md | 9 ++++++--- src/uix/eidos/generated/base.css | 2 +- src/uix/eidos/lib/render-css.ts | 7 ++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/uix/eidos/ARCHETYPE_COHERENCE_AUDIT_2026-06-19.md b/src/uix/eidos/ARCHETYPE_COHERENCE_AUDIT_2026-06-19.md index c490d2324..093f64779 100644 --- a/src/uix/eidos/ARCHETYPE_COHERENCE_AUDIT_2026-06-19.md +++ b/src/uix/eidos/ARCHETYPE_COHERENCE_AUDIT_2026-06-19.md @@ -140,8 +140,11 @@ arquetipo). navigation-menu, words). dialog/drawer/popover/dropdown-menu/context-menu/menubar/ tooltip/listbox/select usan `surface-raised`/`surface-default` a dedo → **off-doctrine**. -**Decisión 2 — Radio por defecto = `sm`, vía variable de tema.** -- **NO existe** un `--radius-default` hoy → **hay que definirlo** = `var(--radius-sm)`. +**Decisión 2 — Radio por defecto = `md` (reconsiderado 2026-06-22), vía variable de tema.** +- `--radius-default` = `var(--radius-md)`. (Era `sm`; cambiado a `md` tras comparar + referencias — el default debe igualar el centro de gravedad de los controles eidos + = md/6px, como Bootstrap/Chakra/Radix-medium; `sm` dejaría el default MÁS apretado + que los propios controles. Implementado en `render-css > appendRadiusDeclarations`.) Los componentes sin radio de arquetipo propio lo consumen por defecto. - El **radio concéntrico YA existe** en el shape engine: `[data-shape-nest]` + `border-radius: max(0px, calc(var(--shape-outer-radius) − var(--shape-nest-gap)))`. @@ -809,7 +812,7 @@ cada una — no son faltas per-componente, son los arquetipos que faltan): | eje | canon — QUÉ consumir | NO hacer (deriva) | estado | |---|---|---|---| | **Superficie / elevación** | `data-depth='overlay'\|'modal'\|…` → **bundle completo** (surface·shadow·halo·border·blur·z) | `surface-raised`/`-default` a dedo; `--{c}-overlay-z` propio; frost arbitrario | **LIVE ✓** (B2, 2026-06-22; guard `elevation-plane.test.ts`) | -| **Radio** | `--radius-default`(=sm) / factor global + `[data-shape-nest]` concéntrico | `calc(--radius-md − space)` a mano; px fijo | **A2** | +| **Radio** | `--radius-default`(=md) / factor global + `[data-shape-nest]` concéntrico | `calc(--radius-md − space)` a mano; px fijo | **A2** (default+factor+scaling LIVE; falta migrar concéntricos) | | **Estado (hover/active)** | `--state-{variant}-hover/active` (ghost = state-layer `currentColor`) | `color-mix` ad-hoc; 9 familias sueltas | **A3** | | **Foco** | `--focus-ring-*` + `--focus-ring-surface` + `outline` (HCM-safe); intent vía `data-intent` | tokens de foco propios; box-shadow que muere en HCM | **A3** | | **Label de campo** | rol label canónico (size-relativo + weight/color unificados) | redefinir `--{c}-label-*` | **A4** | diff --git a/src/uix/eidos/generated/base.css b/src/uix/eidos/generated/base.css index 5da5ff9a0..ab2f54380 100644 --- a/src/uix/eidos/generated/base.css +++ b/src/uix/eidos/generated/base.css @@ -162,7 +162,7 @@ --radius-xl: calc(16px * var(--radius-factor) * var(--scaling)); --radius-xxl: calc(20px * var(--radius-factor) * var(--scaling)); --radius-full: 9999px; - --radius-default: var(--radius-sm); + --radius-default: var(--radius-md); --border-width-none: 0px; --border-width-thin: 1px; --border-width-medium: 2px; diff --git a/src/uix/eidos/lib/render-css.ts b/src/uix/eidos/lib/render-css.ts index 891506d2a..ada11c354 100644 --- a/src/uix/eidos/lib/render-css.ts +++ b/src/uix/eidos/lib/render-css.ts @@ -2253,8 +2253,9 @@ function appendScaledMetricDeclarations( // dials roundness or the user zooms. At factor=1 + scaling=100 both are 1, so output // equals the raw value (no regression). `none` (0) and `full` (the pill sentinel) are // emitted verbatim — a factor/zoom must not curve a square corner nor shrink the pill. -// Also emits `--radius-default` (= sm), the archetype default for components without a -// radius reason of their own (Decisión 2 / §13). +// Also emits `--radius-default` (= md), the archetype default for components without a +// radius reason of their own — md is the eidos control center-of-gravity (button / +// field / select-trigger), like Bootstrap / Chakra / Radix-medium (Decisión 2 / §13). function appendRadiusDeclarations( declarations: string[], radius: Record | undefined @@ -2272,7 +2273,7 @@ function appendRadiusDeclarations( ) ) } - declarations.push(cssVar('radius-default', 'var(--radius-sm)')) + declarations.push(cssVar('radius-default', 'var(--radius-md)')) } function mergeThemeColor(