Remove Eidos flat API residue

active-uix
dev 5 months ago
parent 8194ad3a98
commit cdf47c1f53

@ -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 <Toaster>" 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

@ -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))

@ -233,36 +233,6 @@
color: var(--checkbox-group-label-color-disabled);
}
/* ── Flat <Checkbox label> 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. */

@ -52,7 +52,7 @@ export type ToastViewportProps = SomaToastViewportProps & {
};
/**
* Flat `<Toaster>` — the ergonomic 90 % case. Mounts once per app
* Convenience `<Toaster>` — 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 }]>;

Loading…
Cancel
Save

Powered by TurnKey Linux.