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/soma/layers/index.ts

24 lines
960 B

Refactor soma: consolidate layers, add Soma class, Dialog component, animation system Layers: - Consolidate 28 files/10 dirs → 13 files/2 dirs - Separate behavior layers (classes) from internal components - Normalize naming: Dismissal, ScrollLock, TextSelection, FocusScope - Adapt floating layer from terra to soma (imports, CSS vars --soma--) - Presence rewritten: data-starting/ending-style, forceMount, onComplete, getAnimations API Architecture: - Replace config/ with Soma class (root instance with services) - Add SomaFormat namespace (date, number, currency, unit formatters) - Add generic resolve() for prop → config → fallback chain - Provider supports optional ref (ProviderOpts vs WithRefOpts) - Hierarchical component barrel: import { Dialog } from '$soma/components' - Descriptive IDs: soma-dialog-trigger-c12 Dialog component (7 parts): - Provider, Trigger, Content, Overlay, Title, Description, Close - Content integrates all behavior layers as classes (no template nesting) - modal prop controls interactOutsideBehavior automatically - Nested dialog support: depth, data-nested, --soma-dialog-depth CSS vars - Animation support: forceMount, data-starting/ending-style, onOpenChangeComplete - Translator integration for aria-labels - JSDoc documentation on all props Bug fixes: - Presence mount without ref (chicken-and-egg) - ScrollLock unlock path restores body style - Nested dialog infinite loop (untrack mutation) - pointer-events: none blocking dialog interaction Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
// ── Behavior layers (classes — consumed by Providers) ────────────────────────
export { Presence, type PresenceOptions, type TransitionStatus } from './presence.svelte';
export { FocusScope } from './focus-scope.svelte';
export { Dismissal, type DismissalOpts, type DismissalBehavior } from './dismissal.svelte';
export { TextSelection, type TextSelectionOpts } from './text-selection.svelte';
export { ScrollLock, type ScrollLockOption } from './scroll-lock.svelte';
export { ResizeObserver$ } from './resize-observer.svelte';
export { ZoomPan, type ZoomPanConfig } from './zoom-pan.svelte';
export {
ImageProvider,
type ImageProviderOptions,
type ImageStatus
} from './image-provider.svelte';
soma: gesture layer, drawer component, full audit fixes across 26 components Gesture Layer: - Gesture.base(), Gesture.drag(), Gesture.resize() — shared pointer tracking - VelocityTracker with ring buffer, staleness check, projection - 52 tests (velocity + gesture integration) - setPointerCapture deferred until moveBuffer exceeded (prevents click stealing) Drawer Component: - 8 parts: Provider, Trigger, Content, Overlay, Handle, Title, Description, Close - Gesture.drag() integration for swipe dismiss - Snap points (fractional + px), fadeFromIndex, handle tap-to-cycle - Modal/non-modal/non-dismissible modes - Logical directions (start/end) RTL-aware via soma presentation - CSS custom properties (--drawer-progress, --drawer-offset-x/y) Architecture: - T1: 219 files migrated from $soma/ alias to relative paths - T2: 35 wrappers — noop replaced with () => {} inline - Translation system: componentLangs + common.buttons.* + idlangref constants - COMPONENT_GUIDE.md + README.md fully updated to reflect current patterns - contracts.ts: case-normalized registerContract/assertContract Audit Fixes (P0 critical): - DI1/PO1/TO1: 'provider' → 'root' in parts/contract/super - TB1: data-table attr on wrapper - CH1/SW1/NF4: hidden input rendering fixes - SP2: panel cleanup on unmount - RG1: roving tabindex fallback to first item - CO1: aria-labelledby on collapsible content Audit Fixes (P1 high): - SafePolygon integrated in dropdown-menu SubProvider + tooltip - 9 langs.ts files with idlangref constants - Dialog: aria-label removed (WCAG 2.5.3), handleOpen/Close guards - Stepper: count decrement + private, aria-label on List - ToggleGroup: roving tabindex in multiple mode - Select: pure aria-activedescendant (no mixed focus), label registry - NumberField: startValue respects min, scrubber commit on pointerup only - Toolbar: element-based focus tracking (not index) Audit Fixes (P2 medium): - A6: timer/listener cleanup in 6 components - A12: getDirectionalKeys in 4 components - A10: DOM queries scoped to root in 3 components - Dropdown-menu: typeahead + Home/End in SubContent, activate() pattern - Checkbox: PrimitiveLabelAttributes, getAriaChecked helper, stale value cleanup - Pagination: reactive page clamping, Set-based computePageRange - Scroll-area: thumbSize zero-guard, mount flash prevention - Splitter: collapse/expand respects adjacent constraints, immediate pointer capture 5 issues remain (design decisions): stepper registry, table sub-row IDs, tags-input ARIA model, tags-input paste, toast exit animation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
export { Gesture } from './gesture';
export {
AxialDrag,
type AxialAxis,
type AxialDragOpts,
type AxialDragState,
type AxialReleaseState,
type AxialSnap,
type AxialStartSide
} from './manipulation';

Powered by TurnKey Linux.