import { semaSelector } from '$uix/morfo'; import { collapsibleMorfo } from '$uix/morfo/components/collapsible'; import type { Sema } from '../sema-map'; /** * Collapsible perceptual defaults — MIRRORS ACCORDION. * * Collapsible is the single-panel sibling of Accordion (which already * ships a pack). Coherence demands they share the perceptual signature: * a user disclosing a section gets the same cue regardless of whether * the surface is grouped (accordion) or standalone (collapsible). * * Per `src/uix/sema/components/accordion.ts`: * - `emerge-expand` (emerge.expand): `emerge.soft` — soft chime at * gain 0.08. The family base ascending contour reads as "panel * reveals". * - `emerge-collapse` (emerge.collapse): `emerge.exit` at gain 0.06 * — descending pitch, same direction discipline as the rest of the * system (dialog, drawer, popover, menus). * * No haptic — disclosure is a deliberate, already-acknowledged gesture * on a trigger button; tactile feedback on top would be noise. */ const onContent = (matchers?: Parameters>[2]) => semaSelector(collapsibleMorfo, 'content', matchers); export const collapsibleSema: Sema = { name: 'collapsible', cascade: [ { selector: onContent({ eventName: 'emerge-expand' }) }, { selector: onContent({ eventName: 'emerge-collapse' }) } ] };