Non-modal menus:
- DropdownMenu + ContextMenu default to trapFocus=false + preventScroll=false
(were modal — hard focus-trap + body scroll-lock that made them feel stuck).
Menus stay navigable while open (Chakra-style); the props remain for an opt-in
modal menu. morfo focus.trap=false + the demo control defaults aligned.
list-surface — ONE shared size source for list surfaces:
- new lib/list-surface.css (--list-* keyed on [data-list-surface][data-size], 1:1
with the control sizes) + lib/list-surface-context.ts (shared size context for
portaled sub-panels). DropdownMenu/ContextMenu/Menubar/Listbox bridge their
--{c}-* size tokens to --list-*; ContextMenu gained the size axis it lacked.
Row-height doctrine — unified to CONTROL-HEIGHT:
- archetypes.css [data-archetype=item/option] gains a fallback-guarded control-
height FLOOR (min-block-size: var(--list-item-height, auto) + padding-block:
var(--list-item-py, var(--space-1-5))) — ZERO regression off a list-surface
(the ~45 non-list archetype consumers are untouched). Select/Combobox/Command
stamp data-list-surface so their option rows inherit the floor, matching menu
items. Verified: select option md 36px / lg 44px = menu items; bare archetype
item unchanged (0 floor, --space-1-5 padding).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
active-uix
parent
d0312ee94f
commit
599c142124
@ -0,0 +1,30 @@
|
||||
import { getContext, setContext } from 'svelte';
|
||||
import type { Size } from './types';
|
||||
|
||||
/**
|
||||
* Shared list-surface size context.
|
||||
*
|
||||
* Every floating list surface (action menus + selection popups) propagates its
|
||||
* resolved `size` through this ONE context so nested / fly-out panels match the
|
||||
* root surface's scale. Portaled panels (a `SubContent`, a Combobox listbox)
|
||||
* leave the root Content's DOM subtree, so the size can't reach them by CSS
|
||||
* inheritance — it rides the component tree instead. Replaces the per-component
|
||||
* size contexts so all list surfaces share a single source.
|
||||
*/
|
||||
const LIST_SURFACE_SIZE_CONTEXT = Symbol('uix.eidos.list-surface.size');
|
||||
|
||||
export type ListSurfaceSize = Extract<Size, 'xs' | 'sm' | 'md' | 'lg' | 'xl'>;
|
||||
|
||||
export interface ListSurfaceSizeContext {
|
||||
/** The resolved list-surface size; nested panels read it to match the root. */
|
||||
getSize(): ListSurfaceSize;
|
||||
}
|
||||
|
||||
export function setListSurfaceSizeContext(ctx: ListSurfaceSizeContext): ListSurfaceSizeContext {
|
||||
setContext(LIST_SURFACE_SIZE_CONTEXT, ctx);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
export function getListSurfaceSizeContext(): ListSurfaceSizeContext | undefined {
|
||||
return getContext<ListSurfaceSizeContext | undefined>(LIST_SURFACE_SIZE_CONTEXT);
|
||||
}
|
||||
Loading…
Reference in new issue