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.
39 lines
1.4 KiB
39 lines
1.4 KiB
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<typeof semaSelector<typeof collapsibleMorfo>>[2]) =>
|
|
semaSelector(collapsibleMorfo, 'content', matchers);
|
|
|
|
export const collapsibleSema: Sema = {
|
|
name: 'collapsible',
|
|
cascade: [
|
|
{
|
|
selector: onContent({ eventName: 'emerge-expand' })
|
|
},
|
|
{
|
|
selector: onContent({ eventName: 'emerge-collapse' })
|
|
}
|
|
]
|
|
};
|