From cdf47c1f537d518418c3ca1bbca6dd342d22fdbe Mon Sep 17 00:00:00 2001 From: dev Date: Sun, 17 May 2026 01:37:08 +0200 Subject: [PATCH] Remove Eidos flat API residue --- continue.md | 17 +++++++++++ src/uix/eidos/component-api-contract.test.ts | 20 +++++++++++++ .../eidos/components/checkbox/checkbox.css | 30 ------------------- src/uix/eidos/components/toast/types.ts | 4 +-- 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/continue.md b/continue.md index 182c0aac2..6a127ab8f 100644 --- a/continue.md +++ b/continue.md @@ -70,6 +70,23 @@ Actualizacion Eidos intent wording 2026-05-17: - `npx vitest run src/uix/eidos` -> 7 archivos, 81 tests OK. - `npm run check` -> 0 errores, 0 warnings. +Actualizacion Eidos flat residue cleanup 2026-05-17: + +- Retirado CSS muerto de `checkbox.css` para la antigua marca + `data-checkbox-flat` / `data-checkbox-label`; ningun componente ni morfo lo + emitia y chocaba con la convencion actual sin APIs flat. +- `ToasterProps` ya no usa la palabra "Flat" en su docstring; queda descrito + como convenience/default layout para no confundirlo con la API flat retirada. +- `component-api-contract.test.ts` anade guardia contra marcadores + `data-*-flat` en fuentes de componentes Eidos. +- Validado: + - `rg "data-[a-z0-9-]+-flat|flat default|Flat " src/uix/eidos/components` + -> 0 resultados. + - `npx vitest run src/uix/eidos/component-api-contract.test.ts src/uix/eidos/recipe-css-contract.test.ts` + -> 2 archivos, 10 tests OK. + - `npx vitest run src/uix/eidos` -> 7 archivos, 82 tests OK. + - `npm run check` -> 0 errores, 0 warnings. + Actualizacion Eidos config audit 2026-05-17: - Resuelta la parte no-componente de la auditoria consolidada de diff --git a/src/uix/eidos/component-api-contract.test.ts b/src/uix/eidos/component-api-contract.test.ts index 258ea78a3..5eecb1f87 100644 --- a/src/uix/eidos/component-api-contract.test.ts +++ b/src/uix/eidos/component-api-contract.test.ts @@ -4,6 +4,7 @@ import { describe, expect, it } from 'vitest' const COMPONENTS_DIR = 'src/uix/eidos/components' const ROOT_FILE_EXCEPTIONS = new Set(['svg']) +const COMPONENT_SOURCE_FILE = /\.(css|svelte|ts)$/ interface NamespaceContract { component: string @@ -22,6 +23,17 @@ function readComponentDirs(): readonly string[] { .sort() } +function readComponentSourceFiles(dir = COMPONENTS_DIR): readonly { path: string; source: string }[] { + return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => { + const path = join(dir, entry.name) + + if (entry.isDirectory()) return readComponentSourceFiles(path) + if (!entry.isFile() || !COMPONENT_SOURCE_FILE.test(entry.name)) return [] + + return [{ path, source: stripComments(readFileSync(path, 'utf8')) }] + }) +} + function readIndexSource(component: string): string { return stripComments(readFileSync(join(COMPONENTS_DIR, component, 'index.ts'), 'utf8')) } @@ -63,6 +75,14 @@ describe('Eidos component API contract', () => { expect(violations).toEqual([]) }) + it('keeps removed flat API markers out of component source', () => { + const violations = readComponentSourceFiles() + .filter(({ source }) => /\bdata-[a-z0-9-]+-flat\b/.test(source)) + .map(({ path }) => path) + + expect(violations).toEqual([]) + }) + it('keeps every public Eidos component rooted at {component}.svelte', () => { const missingRoots = readComponentDirs() .filter((component) => !ROOT_FILE_EXCEPTIONS.has(component)) diff --git a/src/uix/eidos/components/checkbox/checkbox.css b/src/uix/eidos/components/checkbox/checkbox.css index c16b8ccfb..83587759b 100644 --- a/src/uix/eidos/components/checkbox/checkbox.css +++ b/src/uix/eidos/components/checkbox/checkbox.css @@ -233,36 +233,6 @@ color: var(--checkbox-group-label-color-disabled); } -/* ── Flat wrapper ──────────────────────────────────────── */ - -[data-checkbox-flat] { - display: inline-flex; - align-items: center; - gap: var(--space-2-5); - cursor: pointer; - user-select: none; - color: var(--color-content-primary); -} - -[data-checkbox-flat][data-disabled] { - cursor: not-allowed; - opacity: var(--checkbox-disabled-opacity); -} - -[data-checkbox-flat][data-readonly] { - cursor: default; -} - -[data-checkbox-flat][data-invalid] [data-checkbox-label] { - color: var(--color-threat-text); -} - -[data-checkbox-label] { - font-family: var(--font-ui); - font-size: var(--text-4-size); - line-height: var(--leading-ui); -} - /* ── Reduced motion ───────────────────────────────────────────────────────── * Honour the user's OS preference: skip the stroke draw + state * transition. Indicator just snaps in / out. */ diff --git a/src/uix/eidos/components/toast/types.ts b/src/uix/eidos/components/toast/types.ts index bdc0fb71b..ba822f24c 100644 --- a/src/uix/eidos/components/toast/types.ts +++ b/src/uix/eidos/components/toast/types.ts @@ -52,7 +52,7 @@ export type ToastViewportProps = SomaToastViewportProps & { }; /** - * Flat `` — the ergonomic 90 % case. Mounts once per app + * Convenience `` — the ergonomic 90 % case. Mounts once per app * (typically in the root layout), receives the `toaster` instance, and * renders Provider + Viewport + Item-loop with default content layout * (status icon, title, description, action, close). Use the compound @@ -76,7 +76,7 @@ export type ToasterProps = { label?: string; /** * Custom item renderer. Receives the `ToastData` for each toast. - * When omitted, the flat default layout (status icon by intent + + * When omitted, the default layout (status icon by intent + * title + description + action + close) is used. */ children?: Snippet<[{ item: ToastData }]>;