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.
svelte-kit-vice/src/uix/morfo/components/collapsible.ts

136 lines
3.8 KiB

morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
import type { Morfo } from '../types';
import { v } from '../types';
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
collapsible: migrate to eidos wrapper pattern (third pilot) Third component migrated to the eidos wrapper subdirectory pattern, following the new "check air baseline first" discipline. Air baseline recovered from commit 0a391408^: - air/components/collapsible: 3 wrappers (Provider/Trigger/Content) with `class` passthrough, `bind:open`, `onOpenChange`, manual `air.interaction.play('expansion', enter|exit)` perceptual emit. - No size, intent, color, or chevron slot. Migration decisions (presented BEFORE coding per scope-approval rule): - Two doctrinal events (`expand` + `collapse`, both emerge family, sequence='pre', no intent — emerge is transitional). Replaces air's manual `air.interaction.play` with `runtime.trigger('expand'| 'collapse')` which atravieses visual + sound + vibra channels. - No intent/color/size — air didn't have them and disclosure is non-evaluative per guide §3.1. - Multi-part API: Provider + Trigger + Content (no flat default per doctrine §10). Files: - src/uix/morfo/components/collapsible.ts: scope expanded to ['soma', 'sema'], events array added with two emerge events. - src/uix/soma/components/collapsible/collapsible-provider.svelte.ts: runtime.events handlers `expand`/`collapse` mutate state; toggle() fires runtime.trigger(next ? 'expand' : 'collapse'). - src/uix/eidos/components/collapsible/{collapsible.css, collapsible-provider.svelte, collapsible-trigger.svelte, collapsible-content.svelte, types.ts, index.ts, README.md}. - src/uix/eidos/components/collapsible.css (legacy flat) deleted. - src/uix/eidos/index.css: import path updated to subdirectory. - web/routes/collapsible/+page.svelte: full interactive testbed with tabs (Live, Soma, Morfo, Sema, Eidos, Notes) mirroring switch's structure. Sema tab shows per-channel signature cards for both expand and collapse events. Disciplina formalizada en CLAUDE.md hand-off + memory entry: "Check air baseline first" before any future eidos migration. Switch shipped without this check and lost ResponsiveProp<Size> (regression). Don't repeat with collapsible/dialog/drawer/popover/toast/avatar. npm run check holds at the 39-error baseline. Tests 218/218 green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
/**
* Collapsible — disclosure pattern (header + body).
*
* Per `src/docs/GUIA_IMPLEMENTACION_SEMAUIX.md` §4.1 (Accordion =
* emerge.expand): the disclosure flip has two perceptual directions
* with distinct signatures, so it declares TWO events instead of one
* `commit-toggle`. Both belong to the `emerge` family (transitional —
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho componentes y `emerge-open` en tres. No era estetica — un preset de movimiento engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna firma y simplemente no animaba, sin romper una sola prueba. Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos, 256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran 40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y `handle-drop` ya existian en 10 y 4 componentes. `validateMorfo` cierra la puerta: un `events[].name` que no empiece por su familia ahora lanza. Visto fallar antes con un nombre pelado inyectado. Lo que el renombrado destapo, y va aqui tambien: - La receta del splitter enganchaba `commit-resize`, muerto desde `bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el catalogo de morfos — el guard que lo habria cazado en su dia. - La familia `shift` era muda en el canal visual, contra su propia doctrina (c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora tiene firma direccional: sexto atributo del sello (`data-event-direction`, `forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por `:dir()`. Medido: LTR -30px/+30px, RTL los invierte. - El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues —media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze` moria sin pintar un fotograma. Una superficie, una ranura (A-36). - 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de decision, el componente vivo). Las docs desfasadas, corregidas; los nueve DEFECTOS de codigo obsoleto quedan abiertos y sin tocar. - `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y habia tres cosas distintas deletreadas «direction». check en su linea base con 0 errores nuevos por diferencia de conjuntos · docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador medidas con raton real y rAF vivo. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
* no intent). `emerge-expand` is post-sequence so the content exists
* visually before Eidos reacts to `data-event='emerge-expand'`;
* `emerge-collapse` is post too (collapsible-NEW-001) so the conceal
* plays against a content the flip has not yet hidden.
collapsible: migrate to eidos wrapper pattern (third pilot) Third component migrated to the eidos wrapper subdirectory pattern, following the new "check air baseline first" discipline. Air baseline recovered from commit 0a391408^: - air/components/collapsible: 3 wrappers (Provider/Trigger/Content) with `class` passthrough, `bind:open`, `onOpenChange`, manual `air.interaction.play('expansion', enter|exit)` perceptual emit. - No size, intent, color, or chevron slot. Migration decisions (presented BEFORE coding per scope-approval rule): - Two doctrinal events (`expand` + `collapse`, both emerge family, sequence='pre', no intent — emerge is transitional). Replaces air's manual `air.interaction.play` with `runtime.trigger('expand'| 'collapse')` which atravieses visual + sound + vibra channels. - No intent/color/size — air didn't have them and disclosure is non-evaluative per guide §3.1. - Multi-part API: Provider + Trigger + Content (no flat default per doctrine §10). Files: - src/uix/morfo/components/collapsible.ts: scope expanded to ['soma', 'sema'], events array added with two emerge events. - src/uix/soma/components/collapsible/collapsible-provider.svelte.ts: runtime.events handlers `expand`/`collapse` mutate state; toggle() fires runtime.trigger(next ? 'expand' : 'collapse'). - src/uix/eidos/components/collapsible/{collapsible.css, collapsible-provider.svelte, collapsible-trigger.svelte, collapsible-content.svelte, types.ts, index.ts, README.md}. - src/uix/eidos/components/collapsible.css (legacy flat) deleted. - src/uix/eidos/index.css: import path updated to subdirectory. - web/routes/collapsible/+page.svelte: full interactive testbed with tabs (Live, Soma, Morfo, Sema, Eidos, Notes) mirroring switch's structure. Sema tab shows per-channel signature cards for both expand and collapse events. Disciplina formalizada en CLAUDE.md hand-off + memory entry: "Check air baseline first" before any future eidos migration. Switch shipped without this check and lost ResponsiveProp<Size> (regression). Don't repeat with collapsible/dialog/drawer/popover/toast/avatar. npm run check holds at the 39-error baseline. Tests 218/218 green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
*
* No intent / color subset — disclosure is non-evaluative. Air had a
* manual `air.interaction.play('expansion', enter|exit)` that the
* sema engine now subsumes via runtime.trigger.
*/
soma/morfo: typed createAttrs + 6 audit batches + form hang fix + A36 ## morfo: typed createAttrs - `types.ts`: all array fields are now `readonly` so morfos can be authored with `as const satisfies Morfo` without casts. - `createAttrs` is a generic `<const M extends MorfoShape>` that infers the emitted attr map from the morfo's literal shape. Typos like `attrs.trigerr` are now compile errors; autocomplete lists every valid part. - All 66 morfos migrated: `export const xMorfo = { ... } as const satisfies Morfo`. - Two latent bugs the new typing caught: `dateRangeFieldAttrs.root` and `timeRangeFieldAttrs.root` — legacy from the root→provider refactor, fixed to `.provider`. - Docs (morfo/README, COMPONENT_GUIDE) mandate `as const satisfies Morfo`; the older `: Morfo` annotation widens literals and loses autocomplete. ## Audit batches 1–7 (soma-audit-2026-04-20) Batch 1 — Keyboard a11y (A14/A12): - Tabs: `isFallbackTabStop(el)` using `untrack` → first trigger gets `tabindex=0` when no tab matches (WCAG 2.1.1 was failing). - RatingGroup: `dir` prop + `getDirectionalKeys(dir, 'horizontal')` for RTL. - Accordion P1-1/P1-6 dismissed: roving/labelledby already correct per APG. Batch 2 — A33 reactive collections: Select `labelRegistry` and NavigationMenu `triggerRefs` migrated to `SvelteMap`. Batch 3 — A31 O(N²) fix: RadioGroup lifts `hasSelection` + `isFallbackTabStop` to the provider with `untrack`-wrapped DOM walk. Per-item derivations drop from O(N²) to O(1) per trigger. Batch 4 — Morfo aria sync: toast / time-field / date-field / tabs / tag-group / navigation-menu declare every aria the provider emits (14 entries across 6 files). Batch 5 — Accessible naming props: Tabs.List, ToggleGroup, TreeView, NavigationMenu expose `aria-label?` / `aria-labelledby?` with explicit "required unless labelledby is set" JSDoc. Batch 6 — A30 cleanup: Checkbox `setLabelId` and 5 trigger-ref providers (select/tooltip/link-preview/dropdown-menu/context-menu) migrated from `$effect(() => parent.ref = opts.ref)` to the `Provider` base's `onRefChange` callback (fires via attachRef inside `untrack`). Batch 7 — A11 wrapper thinning: stepper/tree-view wrappers removed `ctx.get()`, providers expose proxy derivations; time/date-range-field inputs use `untrack(() => …)` for one-shot id registration; menubar content's 40-line keyboard nav moved to `MenubarMenuProvider.onContentKeydown`; color-picker area + channel-slider pointer state machines moved to the providers with `onpointerdown/move/up` emitted via `props`. form-auto-fields deferred with justification (reflective schema renderer, not a state-holding wrapper). ## Form hang fix (A36) `runValidate` entered the `isPromiseLike` branch even for sync schemas because sium's Standard-Schema adapter declares `validate: async`. The fallback `return { errors, issues }` read both reactive vars inside the validation `$effect` while the `.then(...)` microtask wrote them → microtask-mediated loop, silent to Svelte's sync effect-depth guard. Symptom: kitchen-sink hung the tab on mount with onChange / onBlur. Fix: `return untrack(() => ({ errors, issues }))`. Regression locked by two new 5s-timeout tests in `form-auto-fields.svelte.test.ts`. Pattern codified as A36 in COMPONENT_GUIDE; CLAUDE.md count updated to A1–A36 / 39 items. ## Verification - `npm run check`: 0 errors in soma/morfo scope (sema demo pre-existing errors untouched). - `npx vitest run src/uix/soma src/uix/morfo`: all tests green (94 + 7 = 101 tests, inc. 2 new form regression tests). - `npm run smoke`: 65/65 routes. - `npx tsx scripts/morfo-check.ts`: 66/66 morfos. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
export const collapsibleMorfo = {
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
name: 'Collapsible',
kebab: 'collapsible',
scope: ['soma', 'sema', 'eidos'],
// expression resolved via the sema pack at
// `src/uix/sema/components/collapsible.ts` — mirrors accordion
// (`emerge.soft` expand + `emerge.exit` collapse). Coherence with
// the sibling disclosure pattern.
expression: 'pack',
texts: {
label: '#?components.collapsible.label|Collapsible'
},
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
apg: 'https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/',
collapsible: migrate to eidos wrapper pattern (third pilot) Third component migrated to the eidos wrapper subdirectory pattern, following the new "check air baseline first" discipline. Air baseline recovered from commit 0a391408^: - air/components/collapsible: 3 wrappers (Provider/Trigger/Content) with `class` passthrough, `bind:open`, `onOpenChange`, manual `air.interaction.play('expansion', enter|exit)` perceptual emit. - No size, intent, color, or chevron slot. Migration decisions (presented BEFORE coding per scope-approval rule): - Two doctrinal events (`expand` + `collapse`, both emerge family, sequence='pre', no intent — emerge is transitional). Replaces air's manual `air.interaction.play` with `runtime.trigger('expand'| 'collapse')` which atravieses visual + sound + vibra channels. - No intent/color/size — air didn't have them and disclosure is non-evaluative per guide §3.1. - Multi-part API: Provider + Trigger + Content (no flat default per doctrine §10). Files: - src/uix/morfo/components/collapsible.ts: scope expanded to ['soma', 'sema'], events array added with two emerge events. - src/uix/soma/components/collapsible/collapsible-provider.svelte.ts: runtime.events handlers `expand`/`collapse` mutate state; toggle() fires runtime.trigger(next ? 'expand' : 'collapse'). - src/uix/eidos/components/collapsible/{collapsible.css, collapsible-provider.svelte, collapsible-trigger.svelte, collapsible-content.svelte, types.ts, index.ts, README.md}. - src/uix/eidos/components/collapsible.css (legacy flat) deleted. - src/uix/eidos/index.css: import path updated to subdirectory. - web/routes/collapsible/+page.svelte: full interactive testbed with tabs (Live, Soma, Morfo, Sema, Eidos, Notes) mirroring switch's structure. Sema tab shows per-channel signature cards for both expand and collapse events. Disciplina formalizada en CLAUDE.md hand-off + memory entry: "Check air baseline first" before any future eidos migration. Switch shipped without this check and lost ResponsiveProp<Size> (regression). Don't repeat with collapsible/dialog/drawer/popover/toast/avatar. npm run check holds at the 39-error baseline. Tests 218/218 green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
events: [
{
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho componentes y `emerge-open` en tres. No era estetica — un preset de movimiento engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna firma y simplemente no animaba, sin romper una sola prueba. Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos, 256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran 40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y `handle-drop` ya existian en 10 y 4 componentes. `validateMorfo` cierra la puerta: un `events[].name` que no empiece por su familia ahora lanza. Visto fallar antes con un nombre pelado inyectado. Lo que el renombrado destapo, y va aqui tambien: - La receta del splitter enganchaba `commit-resize`, muerto desde `bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el catalogo de morfos — el guard que lo habria cazado en su dia. - La familia `shift` era muda en el canal visual, contra su propia doctrina (c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora tiene firma direccional: sexto atributo del sello (`data-event-direction`, `forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por `:dir()`. Medido: LTR -30px/+30px, RTL los invierte. - El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues —media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze` moria sin pintar un fotograma. Una superficie, una ranura (A-36). - 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de decision, el componente vivo). Las docs desfasadas, corregidas; los nueve DEFECTOS de codigo obsoleto quedan abiertos y sin tocar. - `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y habia tres cosas distintas deletreadas «direction». check en su linea base con 0 errores nuevos por diferencia de conjuntos · docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador medidas con raton real y rAF vivo. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
name: 'emerge-expand',
collapsible: migrate to eidos wrapper pattern (third pilot) Third component migrated to the eidos wrapper subdirectory pattern, following the new "check air baseline first" discipline. Air baseline recovered from commit 0a391408^: - air/components/collapsible: 3 wrappers (Provider/Trigger/Content) with `class` passthrough, `bind:open`, `onOpenChange`, manual `air.interaction.play('expansion', enter|exit)` perceptual emit. - No size, intent, color, or chevron slot. Migration decisions (presented BEFORE coding per scope-approval rule): - Two doctrinal events (`expand` + `collapse`, both emerge family, sequence='pre', no intent — emerge is transitional). Replaces air's manual `air.interaction.play` with `runtime.trigger('expand'| 'collapse')` which atravieses visual + sound + vibra channels. - No intent/color/size — air didn't have them and disclosure is non-evaluative per guide §3.1. - Multi-part API: Provider + Trigger + Content (no flat default per doctrine §10). Files: - src/uix/morfo/components/collapsible.ts: scope expanded to ['soma', 'sema'], events array added with two emerge events. - src/uix/soma/components/collapsible/collapsible-provider.svelte.ts: runtime.events handlers `expand`/`collapse` mutate state; toggle() fires runtime.trigger(next ? 'expand' : 'collapse'). - src/uix/eidos/components/collapsible/{collapsible.css, collapsible-provider.svelte, collapsible-trigger.svelte, collapsible-content.svelte, types.ts, index.ts, README.md}. - src/uix/eidos/components/collapsible.css (legacy flat) deleted. - src/uix/eidos/index.css: import path updated to subdirectory. - web/routes/collapsible/+page.svelte: full interactive testbed with tabs (Live, Soma, Morfo, Sema, Eidos, Notes) mirroring switch's structure. Sema tab shows per-channel signature cards for both expand and collapse events. Disciplina formalizada en CLAUDE.md hand-off + memory entry: "Check air baseline first" before any future eidos migration. Switch shipped without this check and lost ResponsiveProp<Size> (regression). Don't repeat with collapsible/dialog/drawer/popover/toast/avatar. npm run check holds at the 39-error baseline. Tests 218/218 green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
semantic: {
family: 'emerge',
verb: 'expand',
target: v.partRef('content'),
sequence: 'post'
collapsible: migrate to eidos wrapper pattern (third pilot) Third component migrated to the eidos wrapper subdirectory pattern, following the new "check air baseline first" discipline. Air baseline recovered from commit 0a391408^: - air/components/collapsible: 3 wrappers (Provider/Trigger/Content) with `class` passthrough, `bind:open`, `onOpenChange`, manual `air.interaction.play('expansion', enter|exit)` perceptual emit. - No size, intent, color, or chevron slot. Migration decisions (presented BEFORE coding per scope-approval rule): - Two doctrinal events (`expand` + `collapse`, both emerge family, sequence='pre', no intent — emerge is transitional). Replaces air's manual `air.interaction.play` with `runtime.trigger('expand'| 'collapse')` which atravieses visual + sound + vibra channels. - No intent/color/size — air didn't have them and disclosure is non-evaluative per guide §3.1. - Multi-part API: Provider + Trigger + Content (no flat default per doctrine §10). Files: - src/uix/morfo/components/collapsible.ts: scope expanded to ['soma', 'sema'], events array added with two emerge events. - src/uix/soma/components/collapsible/collapsible-provider.svelte.ts: runtime.events handlers `expand`/`collapse` mutate state; toggle() fires runtime.trigger(next ? 'expand' : 'collapse'). - src/uix/eidos/components/collapsible/{collapsible.css, collapsible-provider.svelte, collapsible-trigger.svelte, collapsible-content.svelte, types.ts, index.ts, README.md}. - src/uix/eidos/components/collapsible.css (legacy flat) deleted. - src/uix/eidos/index.css: import path updated to subdirectory. - web/routes/collapsible/+page.svelte: full interactive testbed with tabs (Live, Soma, Morfo, Sema, Eidos, Notes) mirroring switch's structure. Sema tab shows per-channel signature cards for both expand and collapse events. Disciplina formalizada en CLAUDE.md hand-off + memory entry: "Check air baseline first" before any future eidos migration. Switch shipped without this check and lost ResponsiveProp<Size> (regression). Don't repeat with collapsible/dialog/drawer/popover/toast/avatar. npm run check holds at the 39-error baseline. Tests 218/218 green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
}
},
{
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho componentes y `emerge-open` en tres. No era estetica — un preset de movimiento engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna firma y simplemente no animaba, sin romper una sola prueba. Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos, 256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran 40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y `handle-drop` ya existian en 10 y 4 componentes. `validateMorfo` cierra la puerta: un `events[].name` que no empiece por su familia ahora lanza. Visto fallar antes con un nombre pelado inyectado. Lo que el renombrado destapo, y va aqui tambien: - La receta del splitter enganchaba `commit-resize`, muerto desde `bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el catalogo de morfos — el guard que lo habria cazado en su dia. - La familia `shift` era muda en el canal visual, contra su propia doctrina (c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora tiene firma direccional: sexto atributo del sello (`data-event-direction`, `forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por `:dir()`. Medido: LTR -30px/+30px, RTL los invierte. - El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues —media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze` moria sin pintar un fotograma. Una superficie, una ranura (A-36). - 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de decision, el componente vivo). Las docs desfasadas, corregidas; los nueve DEFECTOS de codigo obsoleto quedan abiertos y sin tocar. - `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y habia tres cosas distintas deletreadas «direction». check en su linea base con 0 errores nuevos por diferencia de conjuntos · docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador medidas con raton real y rAF vivo. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
name: 'emerge-collapse',
collapsible: migrate to eidos wrapper pattern (third pilot) Third component migrated to the eidos wrapper subdirectory pattern, following the new "check air baseline first" discipline. Air baseline recovered from commit 0a391408^: - air/components/collapsible: 3 wrappers (Provider/Trigger/Content) with `class` passthrough, `bind:open`, `onOpenChange`, manual `air.interaction.play('expansion', enter|exit)` perceptual emit. - No size, intent, color, or chevron slot. Migration decisions (presented BEFORE coding per scope-approval rule): - Two doctrinal events (`expand` + `collapse`, both emerge family, sequence='pre', no intent — emerge is transitional). Replaces air's manual `air.interaction.play` with `runtime.trigger('expand'| 'collapse')` which atravieses visual + sound + vibra channels. - No intent/color/size — air didn't have them and disclosure is non-evaluative per guide §3.1. - Multi-part API: Provider + Trigger + Content (no flat default per doctrine §10). Files: - src/uix/morfo/components/collapsible.ts: scope expanded to ['soma', 'sema'], events array added with two emerge events. - src/uix/soma/components/collapsible/collapsible-provider.svelte.ts: runtime.events handlers `expand`/`collapse` mutate state; toggle() fires runtime.trigger(next ? 'expand' : 'collapse'). - src/uix/eidos/components/collapsible/{collapsible.css, collapsible-provider.svelte, collapsible-trigger.svelte, collapsible-content.svelte, types.ts, index.ts, README.md}. - src/uix/eidos/components/collapsible.css (legacy flat) deleted. - src/uix/eidos/index.css: import path updated to subdirectory. - web/routes/collapsible/+page.svelte: full interactive testbed with tabs (Live, Soma, Morfo, Sema, Eidos, Notes) mirroring switch's structure. Sema tab shows per-channel signature cards for both expand and collapse events. Disciplina formalizada en CLAUDE.md hand-off + memory entry: "Check air baseline first" before any future eidos migration. Switch shipped without this check and lost ResponsiveProp<Size> (regression). Don't repeat with collapsible/dialog/drawer/popover/toast/avatar. npm run check holds at the 39-error baseline. Tests 218/218 green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
semantic: {
family: 'emerge',
verb: 'collapse',
target: v.partRef('content'),
fix(uix): audit Phase 2 — 3 more isolated HIGH findings - select: drop the dead `focus` block from the morfo. Select uses VIRTUAL focus (focus stays on the trigger via aria-activedescendant; items are never DOM-focused), so the declared `trap: true` / `initial: 'first-focusable'` was unimplemented and contradicted the behavior. Matches Combobox (no focus block). [select-002] - dialog: stop double-writing the Content `role`. The morfo declared `role: 'dialog'` (literal) AND the provider set `role = variant` — syncAttrs' dom.apply (which runs after Svelte render) overwrote the provider's `alertdialog` back to `dialog`, so AlertDialog rendered the wrong a11y role. Remove `role` from the morfo (it's variant-dependent, which a literal can't express) → the provider is the sole authority. Also drop the dead `aria-roledescription: undefined` (syncAttrs wrote the morfo value anyway). Browser-verified: alertdialog content -> role='alertdialog'. [dialog-001] - collapsible: `collapse` event -> `sequence: 'post'`. The provider sets `open = false` in the runtime HANDLER, so `pre` deferred the close behind the full perceptual hold — measured 250ms dead delay before the content closed (the Checkbox-lag class). With `post` the content closes immediately; the CSS exit animation is keyed on data-state. Browser-measured: 250ms -> 1ms. [collapsible-NEW-001] Verified: dialog/alert-dialog/select/collapsible provider tests green, morfo:check passes for all four (the 5 unrelated fails — chronos/combobox/fab/ menu-dial/words — are pre-existing and untouched), svelte-check 0 errors in touched files, browser-verified dialog role + collapsible latency. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 months ago
// `post` (not `pre`): the provider sets `open = false` inside the
// runtime HANDLER, so `pre` deferred the close behind the full
// perceptual hold (~250ms measured dead delay — the Checkbox-lag
// class, collapsible-NEW-001). With `post` the content closes
// immediately; the CSS exit animation is keyed on `data-state`.
sequence: 'post'
collapsible: migrate to eidos wrapper pattern (third pilot) Third component migrated to the eidos wrapper subdirectory pattern, following the new "check air baseline first" discipline. Air baseline recovered from commit 0a391408^: - air/components/collapsible: 3 wrappers (Provider/Trigger/Content) with `class` passthrough, `bind:open`, `onOpenChange`, manual `air.interaction.play('expansion', enter|exit)` perceptual emit. - No size, intent, color, or chevron slot. Migration decisions (presented BEFORE coding per scope-approval rule): - Two doctrinal events (`expand` + `collapse`, both emerge family, sequence='pre', no intent — emerge is transitional). Replaces air's manual `air.interaction.play` with `runtime.trigger('expand'| 'collapse')` which atravieses visual + sound + vibra channels. - No intent/color/size — air didn't have them and disclosure is non-evaluative per guide §3.1. - Multi-part API: Provider + Trigger + Content (no flat default per doctrine §10). Files: - src/uix/morfo/components/collapsible.ts: scope expanded to ['soma', 'sema'], events array added with two emerge events. - src/uix/soma/components/collapsible/collapsible-provider.svelte.ts: runtime.events handlers `expand`/`collapse` mutate state; toggle() fires runtime.trigger(next ? 'expand' : 'collapse'). - src/uix/eidos/components/collapsible/{collapsible.css, collapsible-provider.svelte, collapsible-trigger.svelte, collapsible-content.svelte, types.ts, index.ts, README.md}. - src/uix/eidos/components/collapsible.css (legacy flat) deleted. - src/uix/eidos/index.css: import path updated to subdirectory. - web/routes/collapsible/+page.svelte: full interactive testbed with tabs (Live, Soma, Morfo, Sema, Eidos, Notes) mirroring switch's structure. Sema tab shows per-channel signature cards for both expand and collapse events. Disciplina formalizada en CLAUDE.md hand-off + memory entry: "Check air baseline first" before any future eidos migration. Switch shipped without this check and lost ResponsiveProp<Size> (regression). Don't repeat with collapsible/dialog/drawer/popover/toast/avatar. npm run check holds at the 39-error baseline. Tests 218/218 green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
}
}
],
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
parts: [
{
name: 'Provider',
kebab: 'provider',
morfo: catalog `archetype` across 65 components (~265 part declarations) Bulk classification pass that gives every part a cross-component archetype where one applies. Done with `scripts/catalog-archetypes.ts` — a one-shot mechanical mapping based on a kebab → archetype table, plus three manual overrides for components where Provider IS the interactive element. Coverage - 440 part declarations examined. - ~265 received an archetype (provider, trigger, content, overlay, viewport, item, indicator, thumb, track, label, title, description, close, action, header, image, fallback, arrow, separator, group, input, segment). - ~175 left without one — genuinely component-specific (Slider.Range, PinInput.Segment internals, color-picker channel-slider, etc.). Manual overrides (Provider IS the trigger) - Toggle, Switch, Checkbox: their `Provider` part is a `<button>` that the user actually interacts with, not a root container. Archetype set to `'trigger'` instead of the default `'provider'` so eidos can style them alongside Dialog.Trigger / Popover.Trigger / etc. Script (scripts/catalog-archetypes.ts) - Walks every `*.ts` under `src/uix/morfo/components/`. - Inserts `archetype: '...'` directly after the matching `kebab:` line when a mapping exists. - Idempotent — skips parts that already declare an archetype. - Indent-aware — only operates on part kebabs (≥2 tabs), never the morfo root kebab. Bug discovered + fixed mid-pass when radio-group's root kebab `'radio-group'` matched the `'radio-group' → 'group'` alias and inserted at the wrong level (cleaned up by hand). - Reports per-file counts + the list of unmapped kebabs at the end so future passes can extend the mapping. Tests - Updated `omits data-archetype when not declared` test to use a tiny inline morfo (Toggle's Provider now has archetype 'trigger', so it can't be the "no archetype" fixture anymore). Verification - 22/22 runtime tests, full focused suite green. - 66/66 morfo-check (every component still validates against its DOM — archetype is additive, doesn't change emitted attrs apart from the new `data-archetype="..."` which morfo-check doesn't enforce yet). - 68/68 smoke routes. - svelte-check unchanged at 155.
6 months ago
archetype: 'provider',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
kind: 'public',
defaultElement: 'div',
optional: false,
states: ['open', 'closed'],
data: [
soma: Collapsible pilot — multi-part runtime migration Second pilot of MorfoRuntime V1, validating the multi-part case left unproven by Toggle. Collapsible has three providers (provider/trigger/ content), shares root state across them, and uses partRef cross-references (`aria-controls` ↔ `aria-labelledby`). Note on scope The morfo doesn't declare `keyboard` — the Trigger is a `<button>` and relies on native Enter/Space via onclick. So this pilot does NOT exercise `runtime.keydown`; that's deferred to the next pilot with a real keyboard contract (Tabs, Accordion, Listbox). What this pilot validates - Single runtime instance shared across three part-providers, created at the root and accessed by children via the Provider context. - Cross-part state source: all three parts read `open` and `disabled` from the root provider's opts via `states` / `props` source maps. - Cross-part id resolution: `parts.trigger`/`parts.content` getters read from the root's reactive `triggerId`/`contentId` State; partRef on Trigger and Content resolves once the corresponding sibling registers. - Conditional emission with partRef: `aria-controls` (when Content present) and `aria-labelledby` (when Trigger present) toggle correctly as siblings mount/unmount. - Effect timing across multiple parts: each part's effect runs in its own component scope, cleans up on unmount. Morfo update Same fix as Toggle: data entries got explicit `value` sources. `data-state` references `stateRef('open')`; `data-disabled` references `propRef` with `prop-truthy` condition. Without this the runtime had no way to source the values (the legacy provider hard-coded them). Provider migration - CollapsibleProvider creates the runtime in its constructor with shared states/props/parts sources and registers the 'provider' part. - CollapsibleTriggerProvider and CollapsibleContentProvider call `provider.runtime.registerPart(...)` for their slot, and publish their id to the root's State so partRef resolves. - Each part's `props` derivation collapses from ~6 attrs (data-state, data-disabled, role, aria-*, type, etc.) to just `runtime.partProps()` + the few primitive attrs not in the morfo (`disabled`, `onclick`, `hidden`). Verification - 76/76 focused tests green. - 66/66 morfo-check (Collapsible's emitted DOM matches the morfo). - 68/68 smoke routes 200 OK. - svelte-check unchanged.
6 months ago
{ attr: 'data-state', values: ['open', 'closed'], value: v.stateRef('open') },
{
attr: 'data-disabled',
value: v.propRef('disabled'),
severity: 'optional',
condition: { when: 'prop-truthy', prop: 'disabled' }
}
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
],
aria: []
},
{
name: 'Trigger',
kebab: 'trigger',
morfo: catalog `archetype` across 65 components (~265 part declarations) Bulk classification pass that gives every part a cross-component archetype where one applies. Done with `scripts/catalog-archetypes.ts` — a one-shot mechanical mapping based on a kebab → archetype table, plus three manual overrides for components where Provider IS the interactive element. Coverage - 440 part declarations examined. - ~265 received an archetype (provider, trigger, content, overlay, viewport, item, indicator, thumb, track, label, title, description, close, action, header, image, fallback, arrow, separator, group, input, segment). - ~175 left without one — genuinely component-specific (Slider.Range, PinInput.Segment internals, color-picker channel-slider, etc.). Manual overrides (Provider IS the trigger) - Toggle, Switch, Checkbox: their `Provider` part is a `<button>` that the user actually interacts with, not a root container. Archetype set to `'trigger'` instead of the default `'provider'` so eidos can style them alongside Dialog.Trigger / Popover.Trigger / etc. Script (scripts/catalog-archetypes.ts) - Walks every `*.ts` under `src/uix/morfo/components/`. - Inserts `archetype: '...'` directly after the matching `kebab:` line when a mapping exists. - Idempotent — skips parts that already declare an archetype. - Indent-aware — only operates on part kebabs (≥2 tabs), never the morfo root kebab. Bug discovered + fixed mid-pass when radio-group's root kebab `'radio-group'` matched the `'radio-group' → 'group'` alias and inserted at the wrong level (cleaned up by hand). - Reports per-file counts + the list of unmapped kebabs at the end so future passes can extend the mapping. Tests - Updated `omits data-archetype when not declared` test to use a tiny inline morfo (Toggle's Provider now has archetype 'trigger', so it can't be the "no archetype" fixture anymore). Verification - 22/22 runtime tests, full focused suite green. - 66/66 morfo-check (every component still validates against its DOM — archetype is additive, doesn't change emitted attrs apart from the new `data-archetype="..."` which morfo-check doesn't enforce yet). - 68/68 smoke routes. - svelte-check unchanged at 155.
6 months ago
archetype: 'trigger',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
kind: 'public',
defaultElement: 'button',
role: 'button',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
optional: false,
states: ['open', 'closed'],
data: [
soma: Collapsible pilot — multi-part runtime migration Second pilot of MorfoRuntime V1, validating the multi-part case left unproven by Toggle. Collapsible has three providers (provider/trigger/ content), shares root state across them, and uses partRef cross-references (`aria-controls` ↔ `aria-labelledby`). Note on scope The morfo doesn't declare `keyboard` — the Trigger is a `<button>` and relies on native Enter/Space via onclick. So this pilot does NOT exercise `runtime.keydown`; that's deferred to the next pilot with a real keyboard contract (Tabs, Accordion, Listbox). What this pilot validates - Single runtime instance shared across three part-providers, created at the root and accessed by children via the Provider context. - Cross-part state source: all three parts read `open` and `disabled` from the root provider's opts via `states` / `props` source maps. - Cross-part id resolution: `parts.trigger`/`parts.content` getters read from the root's reactive `triggerId`/`contentId` State; partRef on Trigger and Content resolves once the corresponding sibling registers. - Conditional emission with partRef: `aria-controls` (when Content present) and `aria-labelledby` (when Trigger present) toggle correctly as siblings mount/unmount. - Effect timing across multiple parts: each part's effect runs in its own component scope, cleans up on unmount. Morfo update Same fix as Toggle: data entries got explicit `value` sources. `data-state` references `stateRef('open')`; `data-disabled` references `propRef` with `prop-truthy` condition. Without this the runtime had no way to source the values (the legacy provider hard-coded them). Provider migration - CollapsibleProvider creates the runtime in its constructor with shared states/props/parts sources and registers the 'provider' part. - CollapsibleTriggerProvider and CollapsibleContentProvider call `provider.runtime.registerPart(...)` for their slot, and publish their id to the root's State so partRef resolves. - Each part's `props` derivation collapses from ~6 attrs (data-state, data-disabled, role, aria-*, type, etc.) to just `runtime.partProps()` + the few primitive attrs not in the morfo (`disabled`, `onclick`, `hidden`). Verification - 76/76 focused tests green. - 66/66 morfo-check (Collapsible's emitted DOM matches the morfo). - 68/68 smoke routes 200 OK. - svelte-check unchanged.
6 months ago
{ attr: 'data-state', values: ['open', 'closed'], value: v.stateRef('open') },
{
attr: 'data-disabled',
value: v.propRef('disabled'),
severity: 'optional',
condition: { when: 'prop-truthy', prop: 'disabled' }
}
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
],
aria: [
{ attr: 'type', value: v.literal('button') },
{ attr: 'aria-expanded', value: v.stateRef('open') },
{
attr: 'aria-controls',
value: v.partRef('content'),
condition: { when: 'part-present', part: 'content' },
severity: 'recommended'
}
]
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
},
{
name: 'Content',
kebab: 'content',
morfo: catalog `archetype` across 65 components (~265 part declarations) Bulk classification pass that gives every part a cross-component archetype where one applies. Done with `scripts/catalog-archetypes.ts` — a one-shot mechanical mapping based on a kebab → archetype table, plus three manual overrides for components where Provider IS the interactive element. Coverage - 440 part declarations examined. - ~265 received an archetype (provider, trigger, content, overlay, viewport, item, indicator, thumb, track, label, title, description, close, action, header, image, fallback, arrow, separator, group, input, segment). - ~175 left without one — genuinely component-specific (Slider.Range, PinInput.Segment internals, color-picker channel-slider, etc.). Manual overrides (Provider IS the trigger) - Toggle, Switch, Checkbox: their `Provider` part is a `<button>` that the user actually interacts with, not a root container. Archetype set to `'trigger'` instead of the default `'provider'` so eidos can style them alongside Dialog.Trigger / Popover.Trigger / etc. Script (scripts/catalog-archetypes.ts) - Walks every `*.ts` under `src/uix/morfo/components/`. - Inserts `archetype: '...'` directly after the matching `kebab:` line when a mapping exists. - Idempotent — skips parts that already declare an archetype. - Indent-aware — only operates on part kebabs (≥2 tabs), never the morfo root kebab. Bug discovered + fixed mid-pass when radio-group's root kebab `'radio-group'` matched the `'radio-group' → 'group'` alias and inserted at the wrong level (cleaned up by hand). - Reports per-file counts + the list of unmapped kebabs at the end so future passes can extend the mapping. Tests - Updated `omits data-archetype when not declared` test to use a tiny inline morfo (Toggle's Provider now has archetype 'trigger', so it can't be the "no archetype" fixture anymore). Verification - 22/22 runtime tests, full focused suite green. - 66/66 morfo-check (every component still validates against its DOM — archetype is additive, doesn't change emitted attrs apart from the new `data-archetype="..."` which morfo-check doesn't enforce yet). - 68/68 smoke routes. - svelte-check unchanged at 155.
6 months ago
archetype: 'content',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
kind: 'public',
defaultElement: 'div',
role: 'region',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
optional: false,
states: ['open', 'closed'],
data: [
soma: Collapsible pilot — multi-part runtime migration Second pilot of MorfoRuntime V1, validating the multi-part case left unproven by Toggle. Collapsible has three providers (provider/trigger/ content), shares root state across them, and uses partRef cross-references (`aria-controls` ↔ `aria-labelledby`). Note on scope The morfo doesn't declare `keyboard` — the Trigger is a `<button>` and relies on native Enter/Space via onclick. So this pilot does NOT exercise `runtime.keydown`; that's deferred to the next pilot with a real keyboard contract (Tabs, Accordion, Listbox). What this pilot validates - Single runtime instance shared across three part-providers, created at the root and accessed by children via the Provider context. - Cross-part state source: all three parts read `open` and `disabled` from the root provider's opts via `states` / `props` source maps. - Cross-part id resolution: `parts.trigger`/`parts.content` getters read from the root's reactive `triggerId`/`contentId` State; partRef on Trigger and Content resolves once the corresponding sibling registers. - Conditional emission with partRef: `aria-controls` (when Content present) and `aria-labelledby` (when Trigger present) toggle correctly as siblings mount/unmount. - Effect timing across multiple parts: each part's effect runs in its own component scope, cleans up on unmount. Morfo update Same fix as Toggle: data entries got explicit `value` sources. `data-state` references `stateRef('open')`; `data-disabled` references `propRef` with `prop-truthy` condition. Without this the runtime had no way to source the values (the legacy provider hard-coded them). Provider migration - CollapsibleProvider creates the runtime in its constructor with shared states/props/parts sources and registers the 'provider' part. - CollapsibleTriggerProvider and CollapsibleContentProvider call `provider.runtime.registerPart(...)` for their slot, and publish their id to the root's State so partRef resolves. - Each part's `props` derivation collapses from ~6 attrs (data-state, data-disabled, role, aria-*, type, etc.) to just `runtime.partProps()` + the few primitive attrs not in the morfo (`disabled`, `onclick`, `hidden`). Verification - 76/76 focused tests green. - 66/66 morfo-check (Collapsible's emitted DOM matches the morfo). - 68/68 smoke routes 200 OK. - svelte-check unchanged.
6 months ago
{ attr: 'data-state', values: ['open', 'closed'], value: v.stateRef('open') },
{
attr: 'data-disabled',
value: v.propRef('disabled'),
severity: 'optional',
condition: { when: 'prop-truthy', prop: 'disabled' }
}
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
],
aria: [
{
attr: 'aria-labelledby',
value: v.partRef('trigger'),
condition: { when: 'part-present', part: 'trigger' },
severity: 'recommended'
}
]
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
}
]
soma/morfo: typed createAttrs + 6 audit batches + form hang fix + A36 ## morfo: typed createAttrs - `types.ts`: all array fields are now `readonly` so morfos can be authored with `as const satisfies Morfo` without casts. - `createAttrs` is a generic `<const M extends MorfoShape>` that infers the emitted attr map from the morfo's literal shape. Typos like `attrs.trigerr` are now compile errors; autocomplete lists every valid part. - All 66 morfos migrated: `export const xMorfo = { ... } as const satisfies Morfo`. - Two latent bugs the new typing caught: `dateRangeFieldAttrs.root` and `timeRangeFieldAttrs.root` — legacy from the root→provider refactor, fixed to `.provider`. - Docs (morfo/README, COMPONENT_GUIDE) mandate `as const satisfies Morfo`; the older `: Morfo` annotation widens literals and loses autocomplete. ## Audit batches 1–7 (soma-audit-2026-04-20) Batch 1 — Keyboard a11y (A14/A12): - Tabs: `isFallbackTabStop(el)` using `untrack` → first trigger gets `tabindex=0` when no tab matches (WCAG 2.1.1 was failing). - RatingGroup: `dir` prop + `getDirectionalKeys(dir, 'horizontal')` for RTL. - Accordion P1-1/P1-6 dismissed: roving/labelledby already correct per APG. Batch 2 — A33 reactive collections: Select `labelRegistry` and NavigationMenu `triggerRefs` migrated to `SvelteMap`. Batch 3 — A31 O(N²) fix: RadioGroup lifts `hasSelection` + `isFallbackTabStop` to the provider with `untrack`-wrapped DOM walk. Per-item derivations drop from O(N²) to O(1) per trigger. Batch 4 — Morfo aria sync: toast / time-field / date-field / tabs / tag-group / navigation-menu declare every aria the provider emits (14 entries across 6 files). Batch 5 — Accessible naming props: Tabs.List, ToggleGroup, TreeView, NavigationMenu expose `aria-label?` / `aria-labelledby?` with explicit "required unless labelledby is set" JSDoc. Batch 6 — A30 cleanup: Checkbox `setLabelId` and 5 trigger-ref providers (select/tooltip/link-preview/dropdown-menu/context-menu) migrated from `$effect(() => parent.ref = opts.ref)` to the `Provider` base's `onRefChange` callback (fires via attachRef inside `untrack`). Batch 7 — A11 wrapper thinning: stepper/tree-view wrappers removed `ctx.get()`, providers expose proxy derivations; time/date-range-field inputs use `untrack(() => …)` for one-shot id registration; menubar content's 40-line keyboard nav moved to `MenubarMenuProvider.onContentKeydown`; color-picker area + channel-slider pointer state machines moved to the providers with `onpointerdown/move/up` emitted via `props`. form-auto-fields deferred with justification (reflective schema renderer, not a state-holding wrapper). ## Form hang fix (A36) `runValidate` entered the `isPromiseLike` branch even for sync schemas because sium's Standard-Schema adapter declares `validate: async`. The fallback `return { errors, issues }` read both reactive vars inside the validation `$effect` while the `.then(...)` microtask wrote them → microtask-mediated loop, silent to Svelte's sync effect-depth guard. Symptom: kitchen-sink hung the tab on mount with onChange / onBlur. Fix: `return untrack(() => ({ errors, issues }))`. Regression locked by two new 5s-timeout tests in `form-auto-fields.svelte.test.ts`. Pattern codified as A36 in COMPONENT_GUIDE; CLAUDE.md count updated to A1–A36 / 39 items. ## Verification - `npm run check`: 0 errors in soma/morfo scope (sema demo pre-existing errors untouched). - `npx vitest run src/uix/soma src/uix/morfo`: all tests green (94 + 7 = 101 tests, inc. 2 new form regression tests). - `npm run smoke`: 65/65 routes. - `npx tsx scripts/morfo-check.ts`: 66/66 morfos. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
} as const satisfies Morfo;

Powered by TurnKey Linux.