@rcarls/rc-common 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # `@rcarls/rc-common`
2
2
 
3
- Shared controllers and directives for the `@rcarls` web components library. Not a component itself — a set of composable Lit primitives for drag, resize, anchor positioning, keyboard navigation, and focusability testing.
3
+ Shared controllers, directives, and DOM utilities for `rc-webcomponents`.
4
+
5
+ Docs: [https://richardcarls.github.io/rc-webcomponents/](https://richardcarls.github.io/rc-webcomponents/).
4
6
 
5
7
  ---
6
8
 
@@ -14,12 +16,50 @@ npm install @rcarls/rc-common
14
16
 
15
17
  ```js
16
18
  import { DragController, ResizeController, AnchorController } from '@rcarls/rc-common';
17
- import { keyNavigation, mouseMove } from '@rcarls/rc-common';
18
- import { isFocusable, type FocusableElement } from '@rcarls/rc-common';
19
+ import {
20
+ ActiveDescendantController,
21
+ MutationObserverController,
22
+ RafScheduler,
23
+ ScrollObserverController,
24
+ TypeaheadController,
25
+ } from '@rcarls/rc-common';
26
+ import { RovingTabIndexMixin, keyInteraction, keyNavigation, mouseMove } from '@rcarls/rc-common';
27
+ import {
28
+ findNearestScrollAncestor,
29
+ getDirectChild,
30
+ getDirectChildren,
31
+ isFocusable,
32
+ snapToStep,
33
+ valueToPercent,
34
+ warnMissingDirectChild,
35
+ } from '@rcarls/rc-common';
19
36
  ```
20
37
 
21
38
  All exports are tree-shakeable (`sideEffects: false`).
22
39
 
40
+ ## Export inventory
41
+
42
+ Check this inventory before adding package-local interaction or DOM utility code.
43
+
44
+ | Export | Use for |
45
+ |---|---|
46
+ | `ActiveDescendantController` | Managing `aria-activedescendant` virtual focus in listbox / combobox patterns |
47
+ | `AnchorController` | Positioning floating UI relative to an anchor with native CSS anchor positioning and polyfill fallback |
48
+ | `DragController` | Pointer and keyboard drag-to-move behavior |
49
+ | `KeyboardInteractionDirective` / `keyInteraction` | Tracking pointer vs keyboard interaction mode on a rendered element |
50
+ | `KeyboardNavigationDirective` / `keyNavigation` | Mapping APG arrow-key models to navigation actions |
51
+ | `MutationObserverController` | Lifecycle-safe `MutationObserver` wiring for light-DOM or shadow-DOM changes |
52
+ | `MouseMoveDirective` / `mouseMove` | Pointermove callbacks while a pointer drag is active |
53
+ | `NativeChildController`, `getDirectChild`, `getDirectChildren`, `warnMissingDirectChild` | Finding, validating, and tracking consumer-provided native light-DOM children |
54
+ | `RafScheduler` | Coalescing repeated work into one animation frame and canceling on disconnect |
55
+ | `ResizeController` | Pointer and keyboard resize behavior |
56
+ | `RovingTabIndexMixin` | Roving tabindex for components whose child controls receive real DOM focus |
57
+ | `ScrollObserverController` | Scroll threshold and delta observation for scroll-driven component state |
58
+ | `TypeaheadController` | Printable-key buffering for composite widget typeahead |
59
+ | `findNearestScrollAncestor` | Locating the nearest scrollable ancestor for scroll-driven behavior |
60
+ | `isFocusable` | Filtering focusable items for keyboard navigation |
61
+ | `snapToStep`, `valueToPercent` | Slider and range-slider numeric helpers |
62
+
23
63
  ---
24
64
 
25
65
  ## API