|
|
|
|
import { context, type WithRefOpts } from '../../provider';
|
|
|
|
|
import { boolToEmptyStrOrUndef } from '$adom';
|
|
|
|
|
import { readableActive, state, type Active, type ActiveProps } from '$libs/reactive';
|
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
|
|
|
import type { Direction } from '../../types';
|
|
|
|
|
import { Soma } from '../../core/soma.svelte';
|
|
|
|
|
import { SCROLL_AREA_LANGS } from './langs';
|
|
|
|
|
import { isBrowser } from '$adom';
|
soma: audit fixes — 84 issues across 25 components, Table complete
Table component:
- Complete state manager: sorting, filtering, pagination, selection,
column pinning (sticky), column sizing, expandable rows (sub-rows +
detail panels), column visibility
- Provider renders <table> with translated aria-label
- Sorting opt-in per column, consumer places sort buttons
- filteredRowCount/totalRowCount for correct pagination count
- Sub-row IDs hierarchical (parentId.subIndex), no collisions
- Production-grade test page (Swiss Industrial design)
- Full README with all features documented
Critical fixes (10):
- Toast: memory leaks (timer + hotkey listener cleanup via $effect)
- Toast: restartTimer() method for promise-based toasts
- ScrollArea: type='always' now works (check order fix)
- ScrollArea: thumb click no longer triggers track jump
- Tooltip: no crash without <Tooltip.Group> (ctx.getOr)
- Combobox: click-outside-to-close fixed (isValidEvent)
- Popover: stray 'n' character removed from popover.svelte
- TreeView: ARIA ownership fixed (role=treeitem on Branch, not Control)
- Splitter: documented required array spread for reactivity
High fixes (14):
- Checkbox: group disabled/name propagation + checked sync via $effect
- Select: aria-labelledby on content, aria-disabled on items
- Stepper: aria-controls + aria-labelledby cross-linking
- TagsInput: highlightPrev returns to input, role on Control/Item
- Editable: Preview role=button + aria-label
- Pagination: translated aria-label on items
- RadioGroup: removed unused Soma import
Medium fixes (60):
- registerContract() added to all 25 components
- Dead config=getSoma() removed from 7 providers
- Dead imports removed (Tooltip, Popover, Slider, Combobox)
- Dialog: aria-modal conditional on modal prop
- Slider: pointer capture release + onpointercancel
- Popover: hover timeout cleanup, aria-modal support
- Tabs: inactive content hidden + aria-hidden + tabindex=-1
- ToggleGroup: aria-orientation + roving tabindex fallback
- Toolbar: data-disabled on Button
- Stepper: Content tabindex
- TreeView: RTL keyboard support (expand/collapse key swap)
- NumberField: Enter key commit, clampOnBlur, allowMouseWheel, scrubber a11y
- Toast: data-state on root, aria-live on viewport
- ScrollArea: scrollbar aria-label + tabindex
- Collapsible: part root (not provider), aria-controls, role=region
- Tooltip: removed dead provider part from attrs
Architecture:
- COMPONENT_GUIDE.md: 14 audit-derived rules (A1-A14)
- Checklist expanded from 15 to 23 steps
- 8 new HTML primitive types (Table, THead, TBody, TFoot, TR, TH, TD, Caption)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 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
|
|
|
import { scrollAreaMorfo } from '../../../morfo/components/scroll-area';
|
|
|
|
|
import type { SomaRuntime, SomaRuntimePart } from '../../runtime.svelte';
|
|
|
|
|
import type { TimerHandle } from '$timer';
|
soma: audit fixes — 84 issues across 25 components, Table complete
Table component:
- Complete state manager: sorting, filtering, pagination, selection,
column pinning (sticky), column sizing, expandable rows (sub-rows +
detail panels), column visibility
- Provider renders <table> with translated aria-label
- Sorting opt-in per column, consumer places sort buttons
- filteredRowCount/totalRowCount for correct pagination count
- Sub-row IDs hierarchical (parentId.subIndex), no collisions
- Production-grade test page (Swiss Industrial design)
- Full README with all features documented
Critical fixes (10):
- Toast: memory leaks (timer + hotkey listener cleanup via $effect)
- Toast: restartTimer() method for promise-based toasts
- ScrollArea: type='always' now works (check order fix)
- ScrollArea: thumb click no longer triggers track jump
- Tooltip: no crash without <Tooltip.Group> (ctx.getOr)
- Combobox: click-outside-to-close fixed (isValidEvent)
- Popover: stray 'n' character removed from popover.svelte
- TreeView: ARIA ownership fixed (role=treeitem on Branch, not Control)
- Splitter: documented required array spread for reactivity
High fixes (14):
- Checkbox: group disabled/name propagation + checked sync via $effect
- Select: aria-labelledby on content, aria-disabled on items
- Stepper: aria-controls + aria-labelledby cross-linking
- TagsInput: highlightPrev returns to input, role on Control/Item
- Editable: Preview role=button + aria-label
- Pagination: translated aria-label on items
- RadioGroup: removed unused Soma import
Medium fixes (60):
- registerContract() added to all 25 components
- Dead config=getSoma() removed from 7 providers
- Dead imports removed (Tooltip, Popover, Slider, Combobox)
- Dialog: aria-modal conditional on modal prop
- Slider: pointer capture release + onpointercancel
- Popover: hover timeout cleanup, aria-modal support
- Tabs: inactive content hidden + aria-hidden + tabindex=-1
- ToggleGroup: aria-orientation + roving tabindex fallback
- Toolbar: data-disabled on Button
- Stepper: Content tabindex
- TreeView: RTL keyboard support (expand/collapse key swap)
- NumberField: Enter key commit, clampOnBlur, allowMouseWheel, scrubber a11y
- Toast: data-state on root, aria-live on viewport
- ScrollArea: scrollbar aria-label + tabindex
- Collapsible: part root (not provider), aria-controls, role=region
- Tooltip: removed dead provider part from attrs
Architecture:
- COMPONENT_GUIDE.md: 14 audit-derived rules (A1-A14)
- Checklist expanded from 15 to 23 steps
- 8 new HTML primitive types (Table, THead, TBody, TFoot, TR, TH, TD, Caption)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
export type ScrollAreaType = 'hover' | 'scroll' | 'auto' | 'always';
|
|
|
|
|
|
|
|
|
|
// ── Root ─────────────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
interface ScrollAreaOpts
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
extends
|
|
|
|
|
WithRefOpts,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
ActiveProps<{
|
|
|
|
|
type: ScrollAreaType;
|
|
|
|
|
scrollHideDelay: number;
|
|
|
|
|
dir: Direction;
|
|
|
|
|
}> {}
|
|
|
|
|
|
|
|
|
|
export class ScrollAreaProvider {
|
|
|
|
|
readonly opts: ScrollAreaOpts;
|
|
|
|
|
readonly runtimePart: SomaRuntimePart;
|
|
|
|
|
readonly soma: Soma;
|
|
|
|
|
readonly runtime: SomaRuntime;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
static readonly ctx = context<ScrollAreaProvider>('ScrollArea');
|
|
|
|
|
static get(): ScrollAreaProvider | undefined {
|
|
|
|
|
return this.ctx.getOr(undefined) as ScrollAreaProvider | undefined;
|
|
|
|
|
}
|
|
|
|
|
static require(): ScrollAreaProvider {
|
|
|
|
|
return this.ctx.get();
|
|
|
|
|
}
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
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
|
|
|
static create(opts: ScrollAreaOpts) {
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
return new ScrollAreaProvider(opts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Viewport tracking
|
|
|
|
|
viewportRef = state<HTMLElement | null>(null);
|
|
|
|
|
contentWidth = $state(0);
|
|
|
|
|
contentHeight = $state(0);
|
|
|
|
|
viewportWidth = $state(0);
|
|
|
|
|
viewportHeight = $state(0);
|
|
|
|
|
scrollTop = $state(0);
|
|
|
|
|
scrollLeft = $state(0);
|
|
|
|
|
|
|
|
|
|
private resizeObserver: ResizeObserver | null = null;
|
|
|
|
|
|
|
|
|
|
private constructor(opts: ScrollAreaOpts) {
|
|
|
|
|
this.opts = opts;
|
|
|
|
|
this.soma = Soma.require();
|
|
|
|
|
this.runtime = this.soma.runtime(scrollAreaMorfo, {});
|
|
|
|
|
this.runtimePart = this.runtime.part('provider', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this,
|
|
|
|
|
context: ScrollAreaProvider.ctx
|
|
|
|
|
});
|
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
|
|
|
|
|
|
|
|
// Cleanup resize observer on unmount
|
|
|
|
|
$effect(() => {
|
|
|
|
|
return () => this.cleanupResize();
|
|
|
|
|
});
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Overflow detection ───────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
readonly hasOverflowX = $derived.by(() => this.contentWidth > this.viewportWidth);
|
|
|
|
|
readonly hasOverflowY = $derived.by(() => this.contentHeight > this.viewportHeight);
|
|
|
|
|
|
|
|
|
|
// ── Position tracking ────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
readonly isAtTop = $derived.by(() => this.scrollTop <= 0);
|
|
|
|
|
readonly isAtBottom = $derived.by(
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
() => this.scrollTop >= this.contentHeight - this.viewportHeight - 1
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
readonly isAtLeft = $derived.by(() => this.scrollLeft <= 0);
|
|
|
|
|
readonly isAtRight = $derived.by(
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
() => this.scrollLeft >= this.contentWidth - this.viewportWidth - 1
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// ── Scroll progress (0..1) ───────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
getScrollProgressY(): number {
|
|
|
|
|
const max = this.contentHeight - this.viewportHeight;
|
|
|
|
|
return max <= 0 ? 0 : this.scrollTop / max;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getScrollProgressX(): number {
|
|
|
|
|
const max = this.contentWidth - this.viewportWidth;
|
|
|
|
|
return max <= 0 ? 0 : this.scrollLeft / max;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Viewport setup ───────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
setupViewport(el: HTMLElement | null) {
|
|
|
|
|
this.viewportRef.current = el;
|
|
|
|
|
this.cleanupResize();
|
|
|
|
|
|
|
|
|
|
if (!el || !isBrowser) return;
|
|
|
|
|
|
|
|
|
|
const update = () => {
|
|
|
|
|
this.viewportWidth = el.clientWidth;
|
|
|
|
|
this.viewportHeight = el.clientHeight;
|
|
|
|
|
this.contentWidth = el.scrollWidth;
|
|
|
|
|
this.contentHeight = el.scrollHeight;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
update();
|
|
|
|
|
|
|
|
|
|
this.resizeObserver = new ResizeObserver(update);
|
|
|
|
|
this.resizeObserver.observe(el);
|
|
|
|
|
if (el.firstElementChild) {
|
|
|
|
|
this.resizeObserver.observe(el.firstElementChild);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleScroll(el: HTMLElement) {
|
|
|
|
|
this.scrollTop = el.scrollTop;
|
|
|
|
|
this.scrollLeft = el.scrollLeft;
|
|
|
|
|
// Re-measure in case content changed
|
|
|
|
|
this.contentWidth = el.scrollWidth;
|
|
|
|
|
this.contentHeight = el.scrollHeight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private cleanupResize() {
|
|
|
|
|
this.resizeObserver?.disconnect();
|
|
|
|
|
this.resizeObserver = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly props = $derived.by(() =>
|
|
|
|
|
this.runtimePart.assert({
|
|
|
|
|
...this.runtimePart.props,
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
dir: this.opts.dir.current,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
style: {
|
|
|
|
|
position: 'relative',
|
|
|
|
|
'--soma-scroll-area-corner-width':
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
this.hasOverflowX && this.hasOverflowY
|
|
|
|
|
? 'var(--soma-scroll-area-scrollbar-size, 8px)'
|
|
|
|
|
: '0px',
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
'--soma-scroll-area-corner-height':
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
this.hasOverflowX && this.hasOverflowY
|
|
|
|
|
? 'var(--soma-scroll-area-scrollbar-size, 8px)'
|
|
|
|
|
: '0px'
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
},
|
|
|
|
|
'data-overflow-x': boolToEmptyStrOrUndef(this.hasOverflowX),
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
'data-overflow-y': boolToEmptyStrOrUndef(this.hasOverflowY)
|
|
|
|
|
} as const)
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Viewport ────────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
interface ScrollAreaViewportOpts extends WithRefOpts {}
|
|
|
|
|
|
|
|
|
|
export class ScrollAreaViewportProvider {
|
|
|
|
|
readonly opts: ScrollAreaViewportOpts;
|
|
|
|
|
readonly runtimePart: SomaRuntimePart;
|
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
|
|
|
static create(opts: ScrollAreaViewportOpts) {
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
return new ScrollAreaViewportProvider(opts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly provider: ScrollAreaProvider;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
|
|
|
|
private constructor(opts: ScrollAreaViewportOpts) {
|
|
|
|
|
this.opts = opts;
|
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
|
|
|
this.provider = ScrollAreaProvider.require();
|
|
|
|
|
this.runtimePart = this.provider.runtime.part('viewport', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this,
|
|
|
|
|
onRefChange: (el) => {
|
|
|
|
|
this.provider.setupViewport(el);
|
|
|
|
|
}
|
|
|
|
|
});
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly onscroll = (e: Event) => {
|
|
|
|
|
this.provider.handleScroll(e.currentTarget as HTMLElement);
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
};
|
|
|
|
|
|
|
|
|
|
readonly props = $derived.by(() =>
|
|
|
|
|
this.runtimePart.assert({
|
|
|
|
|
...this.runtimePart.props,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
style: {
|
|
|
|
|
overflow: 'scroll',
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
'scrollbar-width': 'none'
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
},
|
|
|
|
|
'data-at-top': boolToEmptyStrOrUndef(this.provider.isAtTop),
|
|
|
|
|
'data-at-bottom': boolToEmptyStrOrUndef(this.provider.isAtBottom),
|
|
|
|
|
'data-at-left': boolToEmptyStrOrUndef(this.provider.isAtLeft),
|
|
|
|
|
'data-at-right': boolToEmptyStrOrUndef(this.provider.isAtRight),
|
|
|
|
|
'data-overflow-x': boolToEmptyStrOrUndef(this.provider.hasOverflowX),
|
|
|
|
|
'data-overflow-y': boolToEmptyStrOrUndef(this.provider.hasOverflowY),
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
onscroll: this.onscroll
|
|
|
|
|
} as const)
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Scrollbar ───────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
type Orientation = 'horizontal' | 'vertical';
|
|
|
|
|
|
|
|
|
|
interface ScrollAreaScrollbarOpts
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
extends
|
|
|
|
|
WithRefOpts,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
ActiveProps<{
|
|
|
|
|
orientation: Orientation;
|
|
|
|
|
}> {}
|
|
|
|
|
|
|
|
|
|
export class ScrollAreaScrollbarProvider {
|
|
|
|
|
readonly opts: ScrollAreaScrollbarOpts;
|
|
|
|
|
readonly runtimePart: SomaRuntimePart;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
static readonly ctx = context<ScrollAreaScrollbarProvider>('ScrollAreaScrollbar');
|
|
|
|
|
static get(): ScrollAreaScrollbarProvider | undefined {
|
|
|
|
|
return this.ctx.getOr(undefined) as ScrollAreaScrollbarProvider | undefined;
|
|
|
|
|
}
|
|
|
|
|
static require(): ScrollAreaScrollbarProvider {
|
|
|
|
|
return this.ctx.get();
|
|
|
|
|
}
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
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
|
|
|
static create(opts: ScrollAreaScrollbarOpts) {
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
return new ScrollAreaScrollbarProvider(opts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly provider: ScrollAreaProvider;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
|
|
|
|
// Visibility state
|
|
|
|
|
visible = $state(false);
|
|
|
|
|
private hideTimer: TimerHandle | null = null;
|
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
|
|
|
private mounted = false;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
hovering = $state(false);
|
|
|
|
|
dragging = $state(false);
|
|
|
|
|
|
|
|
|
|
private constructor(opts: ScrollAreaScrollbarOpts) {
|
|
|
|
|
this.opts = opts;
|
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
|
|
|
this.provider = ScrollAreaProvider.require();
|
|
|
|
|
this.runtimePart = this.provider.runtime.part('scrollbar', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this,
|
|
|
|
|
context: ScrollAreaScrollbarProvider.ctx
|
|
|
|
|
});
|
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
|
|
|
|
|
|
|
|
// Skip initial-mount flash — defer mounted flag to next frame
|
|
|
|
|
const mountedFrame = this.provider.soma.dom.requestFrame(() => {
|
|
|
|
|
this.mounted = true;
|
|
|
|
|
}, opts.ref.current);
|
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
|
|
|
|
|
|
|
|
// Cleanup on unmount
|
|
|
|
|
$effect(() => {
|
|
|
|
|
return () => {
|
|
|
|
|
this.provider.soma.dom.cancelFrame(mountedFrame, opts.ref.current);
|
|
|
|
|
this.clearHideTimer();
|
|
|
|
|
};
|
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
|
|
|
});
|
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar.
Codex audit fixes (2026-04-17):
- Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar
- Toast Root → Item refactor (data-toast-item, resolves part collision)
- TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry
- Combobox label registry, Pagination count=0, Splitter feasible-range clamp
- TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter
- Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/
Switch/Toolbar; Slider thumbLabels per-index
- NumberField startValue saneado, Table getIsSomeSelected filtra visibles
- Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination
First/Last snippet
Supporting changes:
- App layer + ling/logr/glob/util consolidation, tests updates
- Terra/scripts mechanical reformat (quotes, imports)
- Test pages updated to match new APIs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
|
|
|
|
// Reveal the scrollbar on parent scroll for 'scroll' and 'hover' types.
|
|
|
|
|
// Previously lived in the wrapper as an ad-hoc effect.
|
|
|
|
|
$effect(() => {
|
|
|
|
|
void this.provider.scrollTop;
|
|
|
|
|
void this.provider.scrollLeft;
|
|
|
|
|
const type = this.provider.opts.type.current;
|
|
|
|
|
if (type === 'scroll' || type === 'hover') {
|
|
|
|
|
this.show();
|
|
|
|
|
this.scheduleHide();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Reveal on root hover for 'hover' type. Previously the wrapper attached
|
|
|
|
|
// pointerenter/pointerleave listeners to the root element — move that
|
|
|
|
|
// behavior to the provider so the wrapper stays thin.
|
|
|
|
|
$effect(() => {
|
|
|
|
|
const rootEl = this.provider.opts.ref?.current;
|
|
|
|
|
if (!rootEl || this.provider.opts.type.current !== 'hover') return;
|
|
|
|
|
|
|
|
|
|
const onenter = () => this.show();
|
|
|
|
|
const onleave = () => {
|
|
|
|
|
if (!this.dragging) this.scheduleHide();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const cleanupEnter = this.provider.soma.dom.listen(rootEl, 'pointerenter', onenter);
|
|
|
|
|
const cleanupLeave = this.provider.soma.dom.listen(rootEl, 'pointerleave', onleave);
|
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar.
Codex audit fixes (2026-04-17):
- Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar
- Toast Root → Item refactor (data-toast-item, resolves part collision)
- TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry
- Combobox label registry, Pagination count=0, Splitter feasible-range clamp
- TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter
- Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/
Switch/Toolbar; Slider thumbLabels per-index
- NumberField startValue saneado, Table getIsSomeSelected filtra visibles
- Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination
First/Last snippet
Supporting changes:
- App layer + ling/logr/glob/util consolidation, tests updates
- Terra/scripts mechanical reformat (quotes, imports)
- Test pages updated to match new APIs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
return () => {
|
|
|
|
|
cleanupEnter();
|
|
|
|
|
cleanupLeave();
|
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar.
Codex audit fixes (2026-04-17):
- Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar
- Toast Root → Item refactor (data-toast-item, resolves part collision)
- TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry
- Combobox label registry, Pagination count=0, Splitter feasible-range clamp
- TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter
- Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/
Switch/Toolbar; Slider thumbLabels per-index
- NumberField startValue saneado, Table getIsSomeSelected filtra visibles
- Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination
First/Last snippet
Supporting changes:
- App layer + ling/logr/glob/util consolidation, tests updates
- Terra/scripts mechanical reformat (quotes, imports)
- Test pages updated to match new APIs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
};
|
|
|
|
|
});
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private get isVertical(): boolean {
|
|
|
|
|
return this.opts.orientation.current === 'vertical';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private get hasOverflow(): boolean {
|
|
|
|
|
return this.isVertical ? this.provider.hasOverflowY : this.provider.hasOverflowX;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Whether the scrollbar should be displayed based on type and state. */
|
|
|
|
|
readonly shouldShow = $derived.by(() => {
|
|
|
|
|
const type = this.provider.opts.type.current;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
if (type === 'always') return true;
|
soma: audit fixes — 84 issues across 25 components, Table complete
Table component:
- Complete state manager: sorting, filtering, pagination, selection,
column pinning (sticky), column sizing, expandable rows (sub-rows +
detail panels), column visibility
- Provider renders <table> with translated aria-label
- Sorting opt-in per column, consumer places sort buttons
- filteredRowCount/totalRowCount for correct pagination count
- Sub-row IDs hierarchical (parentId.subIndex), no collisions
- Production-grade test page (Swiss Industrial design)
- Full README with all features documented
Critical fixes (10):
- Toast: memory leaks (timer + hotkey listener cleanup via $effect)
- Toast: restartTimer() method for promise-based toasts
- ScrollArea: type='always' now works (check order fix)
- ScrollArea: thumb click no longer triggers track jump
- Tooltip: no crash without <Tooltip.Group> (ctx.getOr)
- Combobox: click-outside-to-close fixed (isValidEvent)
- Popover: stray 'n' character removed from popover.svelte
- TreeView: ARIA ownership fixed (role=treeitem on Branch, not Control)
- Splitter: documented required array spread for reactivity
High fixes (14):
- Checkbox: group disabled/name propagation + checked sync via $effect
- Select: aria-labelledby on content, aria-disabled on items
- Stepper: aria-controls + aria-labelledby cross-linking
- TagsInput: highlightPrev returns to input, role on Control/Item
- Editable: Preview role=button + aria-label
- Pagination: translated aria-label on items
- RadioGroup: removed unused Soma import
Medium fixes (60):
- registerContract() added to all 25 components
- Dead config=getSoma() removed from 7 providers
- Dead imports removed (Tooltip, Popover, Slider, Combobox)
- Dialog: aria-modal conditional on modal prop
- Slider: pointer capture release + onpointercancel
- Popover: hover timeout cleanup, aria-modal support
- Tabs: inactive content hidden + aria-hidden + tabindex=-1
- ToggleGroup: aria-orientation + roving tabindex fallback
- Toolbar: data-disabled on Button
- Stepper: Content tabindex
- TreeView: RTL keyboard support (expand/collapse key swap)
- NumberField: Enter key commit, clampOnBlur, allowMouseWheel, scrubber a11y
- Toast: data-state on root, aria-live on viewport
- ScrollArea: scrollbar aria-label + tabindex
- Collapsible: part root (not provider), aria-controls, role=region
- Tooltip: removed dead provider part from attrs
Architecture:
- COMPONENT_GUIDE.md: 14 audit-derived rules (A1-A14)
- Checklist expanded from 15 to 23 steps
- 8 new HTML primitive types (Table, THead, TBody, TFoot, TR, TH, TD, Caption)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
if (!this.hasOverflow) return false;
|
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
|
|
|
// Skip initial mount to prevent flash
|
|
|
|
|
if (!this.mounted && (type === 'scroll' || type === 'hover')) return false;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
if (type === 'auto') return true;
|
|
|
|
|
if (type === 'hover') return this.visible;
|
|
|
|
|
if (type === 'scroll') return this.visible;
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/** Show the scrollbar (for hover/scroll modes). */
|
|
|
|
|
show() {
|
|
|
|
|
this.clearHideTimer();
|
|
|
|
|
this.visible = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Schedule hiding the scrollbar after delay. */
|
|
|
|
|
scheduleHide() {
|
|
|
|
|
this.clearHideTimer();
|
|
|
|
|
const delay = this.provider.opts.scrollHideDelay.current;
|
|
|
|
|
this.hideTimer = this.provider.soma.uix.timers.schedule(
|
|
|
|
|
this.hideTimerKey,
|
|
|
|
|
delay,
|
|
|
|
|
() => {
|
|
|
|
|
this.hideTimer = null;
|
|
|
|
|
if (!this.hovering && !this.dragging) {
|
|
|
|
|
this.visible = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ replace: true, meta: { component: 'scroll-area', action: 'hide-scrollbar' } }
|
|
|
|
|
);
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private clearHideTimer() {
|
|
|
|
|
if (this.hideTimer) {
|
|
|
|
|
this.hideTimer.cancel();
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
this.hideTimer = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private get hideTimerKey() {
|
|
|
|
|
return `soma:scroll-area:${this.opts.id.current}:hide:${this.opts.orientation.current}`;
|
|
|
|
|
}
|
|
|
|
|
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
readonly onpointerenter = () => {
|
|
|
|
|
this.hovering = true;
|
|
|
|
|
this.show();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
readonly onpointerleave = () => {
|
|
|
|
|
this.hovering = false;
|
|
|
|
|
if (!this.dragging) this.scheduleHide();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Handle click on the track (not thumb) to scroll to that position. */
|
|
|
|
|
readonly onclick = (e: MouseEvent) => {
|
|
|
|
|
const el = this.opts.ref.current;
|
|
|
|
|
const viewport = this.provider.viewportRef.current;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
if (!el || !viewport) return;
|
|
|
|
|
|
|
|
|
|
const rect = el.getBoundingClientRect();
|
|
|
|
|
|
|
|
|
|
if (this.isVertical) {
|
|
|
|
|
const clickRatio = (e.clientY - rect.top) / rect.height;
|
|
|
|
|
const maxScroll = this.provider.contentHeight - this.provider.viewportHeight;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
viewport.scrollTop = clickRatio * maxScroll;
|
|
|
|
|
} else {
|
|
|
|
|
const clickRatio = (e.clientX - rect.left) / rect.width;
|
|
|
|
|
const maxScroll = this.provider.contentWidth - this.provider.viewportWidth;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
viewport.scrollLeft = clickRatio * maxScroll;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ── Scroll value for ARIA ────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
private get scrollPercent(): number {
|
|
|
|
|
return Math.round(
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
(this.isVertical ? this.provider.getScrollProgressY() : this.provider.getScrollProgressX()) *
|
|
|
|
|
100
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly props = $derived.by(() =>
|
|
|
|
|
this.runtimePart.assert({
|
|
|
|
|
...this.runtimePart.props,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
role: 'scrollbar' as const,
|
|
|
|
|
'aria-controls': this.provider.viewportRef.current?.id || undefined,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
'aria-valuenow': this.scrollPercent,
|
|
|
|
|
'aria-valuemin': 0,
|
|
|
|
|
'aria-valuemax': 100,
|
|
|
|
|
'aria-orientation': this.opts.orientation.current,
|
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
|
|
|
'aria-label': this.isVertical
|
|
|
|
|
? this.provider.soma.langs.ts(SCROLL_AREA_LANGS.SCROLLBAR_VERTICAL)
|
|
|
|
|
: this.provider.soma.langs.ts(SCROLL_AREA_LANGS.SCROLLBAR_HORIZONTAL),
|
soma: audit fixes — 84 issues across 25 components, Table complete
Table component:
- Complete state manager: sorting, filtering, pagination, selection,
column pinning (sticky), column sizing, expandable rows (sub-rows +
detail panels), column visibility
- Provider renders <table> with translated aria-label
- Sorting opt-in per column, consumer places sort buttons
- filteredRowCount/totalRowCount for correct pagination count
- Sub-row IDs hierarchical (parentId.subIndex), no collisions
- Production-grade test page (Swiss Industrial design)
- Full README with all features documented
Critical fixes (10):
- Toast: memory leaks (timer + hotkey listener cleanup via $effect)
- Toast: restartTimer() method for promise-based toasts
- ScrollArea: type='always' now works (check order fix)
- ScrollArea: thumb click no longer triggers track jump
- Tooltip: no crash without <Tooltip.Group> (ctx.getOr)
- Combobox: click-outside-to-close fixed (isValidEvent)
- Popover: stray 'n' character removed from popover.svelte
- TreeView: ARIA ownership fixed (role=treeitem on Branch, not Control)
- Splitter: documented required array spread for reactivity
High fixes (14):
- Checkbox: group disabled/name propagation + checked sync via $effect
- Select: aria-labelledby on content, aria-disabled on items
- Stepper: aria-controls + aria-labelledby cross-linking
- TagsInput: highlightPrev returns to input, role on Control/Item
- Editable: Preview role=button + aria-label
- Pagination: translated aria-label on items
- RadioGroup: removed unused Soma import
Medium fixes (60):
- registerContract() added to all 25 components
- Dead config=getSoma() removed from 7 providers
- Dead imports removed (Tooltip, Popover, Slider, Combobox)
- Dialog: aria-modal conditional on modal prop
- Slider: pointer capture release + onpointercancel
- Popover: hover timeout cleanup, aria-modal support
- Tabs: inactive content hidden + aria-hidden + tabindex=-1
- ToggleGroup: aria-orientation + roving tabindex fallback
- Toolbar: data-disabled on Button
- Stepper: Content tabindex
- TreeView: RTL keyboard support (expand/collapse key swap)
- NumberField: Enter key commit, clampOnBlur, allowMouseWheel, scrubber a11y
- Toast: data-state on root, aria-live on viewport
- ScrollArea: scrollbar aria-label + tabindex
- Collapsible: part root (not provider), aria-controls, role=region
- Tooltip: removed dead provider part from attrs
Architecture:
- COMPONENT_GUIDE.md: 14 audit-derived rules (A1-A14)
- Checklist expanded from 15 to 23 steps
- 8 new HTML primitive types (Table, THead, TBody, TFoot, TR, TH, TD, Caption)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
tabindex: -1,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
'data-state': this.shouldShow ? 'visible' : 'hidden',
|
|
|
|
|
'data-orientation': this.opts.orientation.current,
|
|
|
|
|
'data-hover': boolToEmptyStrOrUndef(this.hovering),
|
|
|
|
|
'data-dragging': boolToEmptyStrOrUndef(this.dragging),
|
|
|
|
|
'data-overflow-x': boolToEmptyStrOrUndef(this.provider.hasOverflowX),
|
|
|
|
|
'data-overflow-y': boolToEmptyStrOrUndef(this.provider.hasOverflowY),
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
onpointerenter: this.onpointerenter,
|
|
|
|
|
onpointerleave: this.onpointerleave,
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
onclick: this.onclick
|
|
|
|
|
} as const)
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Thumb ────────────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
interface ScrollAreaThumbOpts extends WithRefOpts {}
|
|
|
|
|
|
|
|
|
|
export class ScrollAreaThumbProvider {
|
|
|
|
|
readonly opts: ScrollAreaThumbOpts;
|
|
|
|
|
readonly runtimePart: SomaRuntimePart;
|
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
|
|
|
static create(opts: ScrollAreaThumbOpts) {
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
return new ScrollAreaThumbProvider(opts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly scrollbar: ScrollAreaScrollbarProvider;
|
|
|
|
|
readonly provider: ScrollAreaProvider;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
|
|
|
|
private dragStartY = 0;
|
|
|
|
|
private dragStartX = 0;
|
|
|
|
|
private dragStartScrollTop = 0;
|
|
|
|
|
private dragStartScrollLeft = 0;
|
|
|
|
|
|
|
|
|
|
private constructor(opts: ScrollAreaThumbOpts) {
|
|
|
|
|
this.opts = opts;
|
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
|
|
|
this.scrollbar = ScrollAreaScrollbarProvider.require();
|
|
|
|
|
this.provider = this.scrollbar.provider;
|
|
|
|
|
this.runtimePart = this.provider.runtime.part('thumb', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this
|
|
|
|
|
});
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private get isVertical(): boolean {
|
|
|
|
|
return this.scrollbar.opts.orientation.current === 'vertical';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Size calculation ─────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
private get thumbSize(): number {
|
|
|
|
|
if (this.isVertical) {
|
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
|
|
|
if (this.provider.contentHeight <= 0) return 0;
|
|
|
|
|
const ratio = this.provider.viewportHeight / this.provider.contentHeight;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
const trackHeight = this.scrollbar.opts.ref.current?.clientHeight ?? 0;
|
|
|
|
|
return Math.max(ratio * trackHeight, 20);
|
|
|
|
|
} else {
|
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
|
|
|
if (this.provider.contentWidth <= 0) return 0;
|
|
|
|
|
const ratio = this.provider.viewportWidth / this.provider.contentWidth;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
const trackWidth = this.scrollbar.opts.ref.current?.clientWidth ?? 0;
|
|
|
|
|
return Math.max(ratio * trackWidth, 20);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private get thumbOffset(): number {
|
|
|
|
|
const scrollbarEl = this.scrollbar.opts.ref.current;
|
|
|
|
|
if (!scrollbarEl) return 0;
|
|
|
|
|
|
|
|
|
|
if (this.isVertical) {
|
|
|
|
|
const trackHeight = scrollbarEl.clientHeight;
|
|
|
|
|
const maxOffset = trackHeight - this.thumbSize;
|
|
|
|
|
return this.provider.getScrollProgressY() * maxOffset;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
} else {
|
|
|
|
|
const trackWidth = scrollbarEl.clientWidth;
|
|
|
|
|
const maxOffset = trackWidth - this.thumbSize;
|
|
|
|
|
return this.provider.getScrollProgressX() * maxOffset;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Drag handling ────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
readonly onpointerdown = (e: PointerEvent) => {
|
|
|
|
|
if (e.button !== 0) return;
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
|
|
const viewport = this.provider.viewportRef.current;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
if (!viewport) return;
|
|
|
|
|
|
|
|
|
|
this.scrollbar.dragging = true;
|
|
|
|
|
this.dragStartY = e.clientY;
|
|
|
|
|
this.dragStartX = e.clientX;
|
|
|
|
|
this.dragStartScrollTop = viewport.scrollTop;
|
|
|
|
|
this.dragStartScrollLeft = viewport.scrollLeft;
|
|
|
|
|
|
|
|
|
|
(e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
readonly onpointermove = (e: PointerEvent) => {
|
|
|
|
|
if (!this.scrollbar.dragging) return;
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
const viewport = this.provider.viewportRef.current;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
const scrollbarEl = this.scrollbar.opts.ref.current;
|
|
|
|
|
if (!viewport || !scrollbarEl) return;
|
|
|
|
|
|
|
|
|
|
if (this.isVertical) {
|
|
|
|
|
const deltaY = e.clientY - this.dragStartY;
|
|
|
|
|
const trackHeight = scrollbarEl.clientHeight;
|
|
|
|
|
const scrollRatio = deltaY / (trackHeight - this.thumbSize);
|
|
|
|
|
const maxScroll = this.provider.contentHeight - this.provider.viewportHeight;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
viewport.scrollTop = this.dragStartScrollTop + scrollRatio * maxScroll;
|
|
|
|
|
} else {
|
|
|
|
|
const deltaX = e.clientX - this.dragStartX;
|
|
|
|
|
const trackWidth = scrollbarEl.clientWidth;
|
|
|
|
|
const scrollRatio = deltaX / (trackWidth - this.thumbSize);
|
|
|
|
|
const maxScroll = this.provider.contentWidth - this.provider.viewportWidth;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
viewport.scrollLeft = this.dragStartScrollLeft + scrollRatio * maxScroll;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
readonly onpointerup = (_e: PointerEvent) => {
|
|
|
|
|
this.scrollbar.dragging = false;
|
|
|
|
|
this.scrollbar.scheduleHide();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
readonly onlostpointercapture = () => {
|
|
|
|
|
this.scrollbar.dragging = false;
|
|
|
|
|
};
|
|
|
|
|
|
soma: audit fixes — 84 issues across 25 components, Table complete
Table component:
- Complete state manager: sorting, filtering, pagination, selection,
column pinning (sticky), column sizing, expandable rows (sub-rows +
detail panels), column visibility
- Provider renders <table> with translated aria-label
- Sorting opt-in per column, consumer places sort buttons
- filteredRowCount/totalRowCount for correct pagination count
- Sub-row IDs hierarchical (parentId.subIndex), no collisions
- Production-grade test page (Swiss Industrial design)
- Full README with all features documented
Critical fixes (10):
- Toast: memory leaks (timer + hotkey listener cleanup via $effect)
- Toast: restartTimer() method for promise-based toasts
- ScrollArea: type='always' now works (check order fix)
- ScrollArea: thumb click no longer triggers track jump
- Tooltip: no crash without <Tooltip.Group> (ctx.getOr)
- Combobox: click-outside-to-close fixed (isValidEvent)
- Popover: stray 'n' character removed from popover.svelte
- TreeView: ARIA ownership fixed (role=treeitem on Branch, not Control)
- Splitter: documented required array spread for reactivity
High fixes (14):
- Checkbox: group disabled/name propagation + checked sync via $effect
- Select: aria-labelledby on content, aria-disabled on items
- Stepper: aria-controls + aria-labelledby cross-linking
- TagsInput: highlightPrev returns to input, role on Control/Item
- Editable: Preview role=button + aria-label
- Pagination: translated aria-label on items
- RadioGroup: removed unused Soma import
Medium fixes (60):
- registerContract() added to all 25 components
- Dead config=getSoma() removed from 7 providers
- Dead imports removed (Tooltip, Popover, Slider, Combobox)
- Dialog: aria-modal conditional on modal prop
- Slider: pointer capture release + onpointercancel
- Popover: hover timeout cleanup, aria-modal support
- Tabs: inactive content hidden + aria-hidden + tabindex=-1
- ToggleGroup: aria-orientation + roving tabindex fallback
- Toolbar: data-disabled on Button
- Stepper: Content tabindex
- TreeView: RTL keyboard support (expand/collapse key swap)
- NumberField: Enter key commit, clampOnBlur, allowMouseWheel, scrubber a11y
- Toast: data-state on root, aria-live on viewport
- ScrollArea: scrollbar aria-label + tabindex
- Collapsible: part root (not provider), aria-controls, role=region
- Tooltip: removed dead provider part from attrs
Architecture:
- COMPONENT_GUIDE.md: 14 audit-derived rules (A1-A14)
- Checklist expanded from 15 to 23 steps
- 8 new HTML primitive types (Table, THead, TBody, TFoot, TR, TH, TD, Caption)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
readonly onclick = (e: MouseEvent) => {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
};
|
|
|
|
|
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
readonly props = $derived.by(() =>
|
|
|
|
|
this.runtimePart.assert({
|
|
|
|
|
...this.runtimePart.props,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
'data-state': this.scrollbar.shouldShow ? 'visible' : 'hidden',
|
|
|
|
|
'data-orientation': this.scrollbar.opts.orientation.current,
|
|
|
|
|
'data-hover': boolToEmptyStrOrUndef(this.scrollbar.hovering),
|
|
|
|
|
'data-dragging': boolToEmptyStrOrUndef(this.scrollbar.dragging),
|
|
|
|
|
style: {
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
[this.isVertical ? 'top' : 'left']: `${this.thumbOffset}px`,
|
|
|
|
|
[this.isVertical ? 'height' : 'width']: `${this.thumbSize}px`,
|
|
|
|
|
[this.isVertical ? 'width' : 'height']: '100%',
|
|
|
|
|
'border-radius': 'inherit',
|
|
|
|
|
'--soma-scroll-area-thumb-width': `${this.isVertical ? '100%' : `${this.thumbSize}px`}`,
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
'--soma-scroll-area-thumb-height': `${this.isVertical ? `${this.thumbSize}px` : '100%'}`
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
},
|
|
|
|
|
onpointerdown: this.onpointerdown,
|
|
|
|
|
onpointermove: this.onpointermove,
|
|
|
|
|
onpointerup: this.onpointerup,
|
|
|
|
|
onlostpointercapture: this.onlostpointercapture,
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
onclick: this.onclick
|
|
|
|
|
} as const)
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Corner ──────────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
interface ScrollAreaCornerOpts extends WithRefOpts {}
|
|
|
|
|
|
|
|
|
|
export class ScrollAreaCornerProvider {
|
|
|
|
|
readonly opts: ScrollAreaCornerOpts;
|
|
|
|
|
readonly runtimePart: SomaRuntimePart;
|
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
|
|
|
static create(opts: ScrollAreaCornerOpts) {
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
return new ScrollAreaCornerProvider(opts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly provider: ScrollAreaProvider;
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
|
|
|
|
private constructor(opts: ScrollAreaCornerOpts) {
|
|
|
|
|
this.opts = opts;
|
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
|
|
|
this.provider = ScrollAreaProvider.require();
|
|
|
|
|
this.runtimePart = this.provider.runtime.part('corner', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this
|
|
|
|
|
});
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
}
|
|
|
|
|
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
readonly shouldShow = $derived.by(() => this.provider.hasOverflowX && this.provider.hasOverflowY);
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
|
|
|
|
readonly props = $derived.by(() =>
|
|
|
|
|
this.runtimePart.assert({
|
|
|
|
|
...this.runtimePart.props,
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
'data-state': this.shouldShow ? 'visible' : 'hidden',
|
|
|
|
|
style: {
|
|
|
|
|
width: 'var(--soma-scroll-area-corner-width)',
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
height: 'var(--soma-scroll-area-corner-height)'
|
|
|
|
|
}
|
|
|
|
|
} as const)
|
soma: 10 new components, README docs for all 22, PrimitiveAnchorAttributes
New components (10):
- Tabs: roving tabindex, automatic/manual activation, onFocusChange
- ToggleGroup: single/multiple, roving tabindex, deselectable
- Toast: imperative API (createToaster), swipe-to-dismiss, hotkey, promise()
- ScrollArea: custom scrollbars, visibility modes, thumb drag, position tracking
- Splitter: resizable panels, collapsible, flex-grow sizing, double-click toggle
- Stepper: multi-step wizard, linear mode, step state, PrevTrigger/NextTrigger
- TreeView: WAI-ARIA tree pattern, expand/collapse, typeahead, * expand siblings
- Pagination: page range algorithm, siblingCount/boundaryCount, slice() utility
- Toolbar: WAI-ARIA toolbar, roving tabindex, integrated ToggleGroup, Separator
- Editable: inline edit, activation/submit modes, draft tracking, auto-resize
Documentation:
- README.md for all 22 components with anatomy, ARIA, data-*, keyboard, usage
- Comparison tables vs ark-ui, bits-ui, radix-ui for every component
Infrastructure:
- Added PrimitiveAnchorAttributes to $soma/types/html.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
);
|
|
|
|
|
}
|