@aihu/primitives 0.0.1

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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -0
  3. package/dist/button-C-8c-A17.js +126 -0
  4. package/dist/button-C-8c-A17.js.map +1 -0
  5. package/dist/button.d.ts +2 -0
  6. package/dist/button.js +2 -0
  7. package/dist/collection.d.ts +26 -0
  8. package/dist/collection.d.ts.map +1 -0
  9. package/dist/collection.js +72 -0
  10. package/dist/collection.js.map +1 -0
  11. package/dist/config-provider.d.ts +39 -0
  12. package/dist/config-provider.d.ts.map +1 -0
  13. package/dist/config-provider.js +112 -0
  14. package/dist/config-provider.js.map +1 -0
  15. package/dist/dialog-y7MHc6vf.js +253 -0
  16. package/dist/dialog-y7MHc6vf.js.map +1 -0
  17. package/dist/dialog.d.ts +2 -0
  18. package/dist/dialog.js +2 -0
  19. package/dist/dom-context.d.ts +40 -0
  20. package/dist/dom-context.d.ts.map +1 -0
  21. package/dist/dom-context.js +64 -0
  22. package/dist/dom-context.js.map +1 -0
  23. package/dist/form-control.d.ts +41 -0
  24. package/dist/form-control.d.ts.map +1 -0
  25. package/dist/form-control.js +145 -0
  26. package/dist/form-control.js.map +1 -0
  27. package/dist/index-D9kf9rVU.d.ts +86 -0
  28. package/dist/index-D9kf9rVU.d.ts.map +1 -0
  29. package/dist/index-DPD4L6Nj.d.ts +31 -0
  30. package/dist/index-DPD4L6Nj.d.ts.map +1 -0
  31. package/dist/index.d.ts +10 -0
  32. package/dist/index.js +10 -0
  33. package/dist/presence-gate.d.ts +33 -0
  34. package/dist/presence-gate.d.ts.map +1 -0
  35. package/dist/presence-gate.js +109 -0
  36. package/dist/presence-gate.js.map +1 -0
  37. package/dist/roving-focus.d.ts +33 -0
  38. package/dist/roving-focus.d.ts.map +1 -0
  39. package/dist/roving-focus.js +159 -0
  40. package/dist/roving-focus.js.map +1 -0
  41. package/dist/tooltip.d.ts +72 -0
  42. package/dist/tooltip.d.ts.map +1 -0
  43. package/dist/tooltip.js +195 -0
  44. package/dist/tooltip.js.map +1 -0
  45. package/package.json +79 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fellwork
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # @aihu/primitives
2
+
3
+ > **Aihu** — agentic discovery and interaction, for human purpose.
4
+
5
+ aihu headless behavior primitives — WAI-ARIA APG patterns as vanilla custom elements, zero CSS.
6
+
7
+ <!-- BEGIN_HANDWRITTEN: prose -->
8
+ The **headless behavior layer** on top of the aihu CSS engine. Every primitive is a
9
+ vanilla custom element that manages focus, keyboard interaction, ARIA wiring, and
10
+ controlled/uncontrolled state — the WAI-ARIA APG patterns — while emitting **NO CSS**.
11
+ Consumers style via the CSS engine's `cn()` + style packs.
12
+
13
+ State lives on `@aihu/signals`; DOM structure comes from `@aihu/arbor`; focus/ARIA use
14
+ native DOM APIs; cross-component coordination uses a self-contained DOM-walk context
15
+ (`@aihu/primitives/context`).
16
+
17
+ ### Surface
18
+
19
+ | Entry | What it is |
20
+ |---|---|
21
+ | `@aihu/primitives/context` | `createDomContext` / `provideContext` / `injectContext` — live DOM-walk ancestor traversal, Symbol-keyed, signal-backed |
22
+ | `@aihu/primitives/presence-gate` | mount/unmount with exit-animation hold |
23
+ | `@aihu/primitives/form-control` | disabled/required/invalid + ARIA association |
24
+ | `@aihu/primitives/config-provider` | colorScheme/density/dir via reactive DOM context |
25
+ | `@aihu/primitives/roving-focus` | arrow-key roving tabindex (orientation/loop/RTL) |
26
+ | `@aihu/primitives/collection` | DOM-ordered descendant registration |
27
+ | `@aihu/primitives/dialog` | dialog-root + pieces (focus-trap, return-focus, escape) — APG Dialog Modal |
28
+ | `@aihu/primitives/tooltip` | tooltip-root + pieces (reuses css-engine `position()` shim) — APG Tooltip |
29
+ | `@aihu/primitives/button` | headless button base (ARIA/keyboard/toggle/disabled) — APG Button |
30
+
31
+ ### Local development
32
+
33
+ ```bash
34
+ bun run build # rolldown multi-entry → dist/<entry>.js
35
+ bun run test # vitest (keyboard + APG conformance)
36
+ bun run typecheck
37
+ ```
38
+ <!-- END_HANDWRITTEN: prose -->
39
+
40
+ ## Install
41
+
42
+ <!-- BEGIN_AUTOGEN: install -->
43
+ <!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->
44
+
45
+ ```bash
46
+ npm install @aihu/primitives
47
+ # or
48
+ bun add @aihu/primitives
49
+ ```
50
+
51
+ <sub><i>Auto-generated against `@aihu/primitives@0.0.1`.</i></sub>
52
+
53
+ <!-- END_AUTOGEN: install -->
54
+
55
+ ## Package facts
56
+
57
+ <!-- BEGIN_AUTOGEN: stats -->
58
+ <!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->
59
+
60
+ | | |
61
+ |---|---|
62
+ | **Version** | `0.0.1` |
63
+ | **Tier** | E — Held private (unmapped tier) |
64
+ | **Published files** | 3 entries |
65
+ | **License** | MIT |
66
+
67
+ <sub><i>Auto-generated against `@aihu/primitives@0.0.1`.</i></sub>
68
+
69
+ <!-- END_AUTOGEN: stats -->
70
+
71
+ ## Exports
72
+
73
+ <!-- BEGIN_AUTOGEN: exports -->
74
+ <!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->
75
+
76
+ | Subpath | ESM | CJS |
77
+ |---|---|---|
78
+ | `.` | `./dist/index.js` | `—` |
79
+ | `./context` | `./dist/dom-context.js` | `—` |
80
+ | `./presence-gate` | `./dist/presence-gate.js` | `—` |
81
+ | `./form-control` | `./dist/form-control.js` | `—` |
82
+ | `./config-provider` | `./dist/config-provider.js` | `—` |
83
+ | `./roving-focus` | `./dist/roving-focus.js` | `—` |
84
+ | `./collection` | `./dist/collection.js` | `—` |
85
+ | `./dialog` | `./dist/dialog.js` | `—` |
86
+ | `./tooltip` | `./dist/tooltip.js` | `—` |
87
+ | `./button` | `./dist/button.js` | `—` |
88
+
89
+ <sub><i>Auto-generated against `@aihu/primitives@0.0.1`.</i></sub>
90
+
91
+ <!-- END_AUTOGEN: exports -->
92
+
93
+ ## Dependencies
94
+
95
+ <!-- BEGIN_AUTOGEN: deps -->
96
+ <!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->
97
+
98
+ **Dependencies:**
99
+
100
+ - `@aihu/signals` — `workspace:*`
101
+ - `@aihu/arbor` — `workspace:*`
102
+ - `@aihu/css-engine` — `workspace:*`
103
+
104
+ <sub><i>Auto-generated against `@aihu/primitives@0.0.1`.</i></sub>
105
+
106
+ <!-- END_AUTOGEN: deps -->
107
+
108
+ ## See also
109
+
110
+ <!-- BEGIN_AUTOGEN: see-also -->
111
+ <!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->
112
+
113
+ - [Aihu framework root](../../README.md)
114
+ - [v1.1 roadmap](../../docs/roadmap/SUMMARY.md)
115
+
116
+ <sub><i>Auto-generated against `@aihu/primitives@0.0.1`.</i></sub>
117
+
118
+ <!-- END_AUTOGEN: see-also -->
119
+
120
+ ## License
121
+
122
+ <!-- BEGIN_AUTOGEN: license -->
123
+ <!-- regenerate: bun scripts/sync-readme.ts (also runs in pre-commit + CI) -->
124
+
125
+ MIT — see [LICENSE](../../LICENSE).
126
+
127
+ <sub><i>Auto-generated against `@aihu/primitives@0.0.1`.</i></sub>
128
+
129
+ <!-- END_AUTOGEN: license -->
@@ -0,0 +1,126 @@
1
+ import { injectValue } from "./dom-context.js";
2
+ import { formControlContext } from "./form-control.js";
3
+ import { effect, signal } from "@aihu/signals";
4
+ //#region src/button/button.ts
5
+ /**
6
+ * `AihuButton` — headless button base class (WAI-ARIA APG Button). Consumers
7
+ * (or Plan 5 recipes) extend it; it is NOT a registered tag in this package.
8
+ * Use `defineButton(tag)` to register a concrete element for tests/consumers.
9
+ *
10
+ * Behavior:
11
+ * - If the host is NOT a native `<button>`, sets `role="button"` +
12
+ * `tabindex="0"` and handles Enter / Space to fire a synthetic `click`
13
+ * (the APG Button keyboard contract). A native `<button>` defers to native
14
+ * semantics.
15
+ * - `aria-pressed` reflects the `pressed` toggle state.
16
+ * - `aria-disabled` + suppressed activation when `disabled`.
17
+ * - Inherits `disabled` from a `FormControlContext` ancestor (Task 5) so a
18
+ * button inside a disabled `form-control` is disabled too.
19
+ * - `data-state` reflects `pressed` / `disabled`. Emits NO CSS.
20
+ */
21
+ var AihuButton = class extends HTMLElement {
22
+ static observedAttributes = [
23
+ "disabled",
24
+ "pressed",
25
+ "type"
26
+ ];
27
+ _disabled = signal(false);
28
+ _pressed = signal(null);
29
+ _inheritedDisabled = null;
30
+ _disposers = [];
31
+ /** True when this is a toggle button (the `pressed` attribute is present). */
32
+ _isToggle = false;
33
+ get disabled() {
34
+ return this._disabled[0];
35
+ }
36
+ get pressed() {
37
+ return this._pressed[0];
38
+ }
39
+ get _isNativeButton() {
40
+ return this.tagName === "BUTTON";
41
+ }
42
+ connectedCallback() {
43
+ this._isToggle = this.hasAttribute("pressed");
44
+ this._syncFromAttrs();
45
+ if (!this._isNativeButton) {
46
+ if (!this.hasAttribute("role")) this.setAttribute("role", "button");
47
+ if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
48
+ this.addEventListener("keydown", this._onKeydown);
49
+ }
50
+ this.addEventListener("click", this._onClickCapture, true);
51
+ try {
52
+ this._inheritedDisabled = injectValue(this, formControlContext).disabled;
53
+ } catch {
54
+ this._inheritedDisabled = null;
55
+ }
56
+ this._disposers.push(effect(() => {
57
+ const disabled = this._effectiveDisabled();
58
+ if (disabled) this.setAttribute("aria-disabled", "true");
59
+ else this.removeAttribute("aria-disabled");
60
+ if (this._isToggle) this.setAttribute("aria-pressed", String(this._pressed[0]() === true));
61
+ this.setAttribute("data-state", this._stateString(disabled));
62
+ }));
63
+ }
64
+ disconnectedCallback() {
65
+ this.removeEventListener("keydown", this._onKeydown);
66
+ this.removeEventListener("click", this._onClickCapture, true);
67
+ for (const d of this._disposers) d();
68
+ this._disposers = [];
69
+ }
70
+ attributeChangedCallback(name, _old, value) {
71
+ switch (name) {
72
+ case "disabled":
73
+ this._disabled[1](value !== null);
74
+ break;
75
+ case "pressed":
76
+ this._isToggle = value !== null ? true : this._isToggle;
77
+ this._pressed[1](value !== null);
78
+ break;
79
+ }
80
+ }
81
+ /** Toggle a toggle-button's pressed state. */
82
+ toggle() {
83
+ if (!this._isToggle) return;
84
+ this._pressed[1](!(this._pressed[0]() === true));
85
+ }
86
+ _effectiveDisabled() {
87
+ if (this._disabled[0]()) return true;
88
+ return this._inheritedDisabled ? this._inheritedDisabled() : false;
89
+ }
90
+ _stateString(disabled) {
91
+ if (disabled) return "disabled";
92
+ if (this._isToggle) return this._pressed[0]() === true ? "on" : "off";
93
+ return "idle";
94
+ }
95
+ _onKeydown = (ev) => {
96
+ if (this._effectiveDisabled()) return;
97
+ if (ev.key === "Enter" || ev.key === " " || ev.key === "Spacebar") {
98
+ ev.preventDefault();
99
+ this.click();
100
+ }
101
+ };
102
+ _onClickCapture = (ev) => {
103
+ if (this._effectiveDisabled()) {
104
+ ev.preventDefault();
105
+ ev.stopImmediatePropagation();
106
+ return;
107
+ }
108
+ if (this._isToggle) this.toggle();
109
+ };
110
+ _syncFromAttrs() {
111
+ this._disabled[1](this.hasAttribute("disabled"));
112
+ if (this._isToggle) this._pressed[1](this.getAttribute("pressed") !== "false");
113
+ }
114
+ };
115
+ /** Register a concrete button tag backed by `AihuButton` (idempotent). */
116
+ function defineButton(tag) {
117
+ if (!customElements.get(tag)) {
118
+ class TaggedButton extends AihuButton {}
119
+ customElements.define(tag, TaggedButton);
120
+ }
121
+ return AihuButton;
122
+ }
123
+ //#endregion
124
+ export { defineButton as n, AihuButton as t };
125
+
126
+ //# sourceMappingURL=button-C-8c-A17.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-C-8c-A17.js","names":[],"sources":["../src/button/button.ts"],"sourcesContent":["/**\n * `AihuButton` — headless button base class (WAI-ARIA APG Button). Consumers\n * (or Plan 5 recipes) extend it; it is NOT a registered tag in this package.\n * Use `defineButton(tag)` to register a concrete element for tests/consumers.\n *\n * Behavior:\n * - If the host is NOT a native `<button>`, sets `role=\"button\"` +\n * `tabindex=\"0\"` and handles Enter / Space to fire a synthetic `click`\n * (the APG Button keyboard contract). A native `<button>` defers to native\n * semantics.\n * - `aria-pressed` reflects the `pressed` toggle state.\n * - `aria-disabled` + suppressed activation when `disabled`.\n * - Inherits `disabled` from a `FormControlContext` ancestor (Task 5) so a\n * button inside a disabled `form-control` is disabled too.\n * - `data-state` reflects `pressed` / `disabled`. Emits NO CSS.\n */\n\nimport { effect, type Read, signal } from '@aihu/signals'\nimport { injectValue } from '../dom-context.ts'\nimport { formControlContext } from '../form-control/index.ts'\n\nexport type ButtonType = 'button' | 'submit' | 'reset'\n\nexport class AihuButton extends HTMLElement {\n static readonly observedAttributes = ['disabled', 'pressed', 'type']\n\n private readonly _disabled = signal(false)\n private readonly _pressed = signal<boolean | null>(null)\n private _inheritedDisabled: Read<boolean> | null = null\n private _disposers: Array<() => void> = []\n\n /** True when this is a toggle button (the `pressed` attribute is present). */\n private _isToggle = false\n\n get disabled(): Read<boolean> {\n return this._disabled[0]\n }\n get pressed(): Read<boolean | null> {\n return this._pressed[0]\n }\n\n private get _isNativeButton(): boolean {\n return this.tagName === 'BUTTON'\n }\n\n connectedCallback(): void {\n this._isToggle = this.hasAttribute('pressed')\n this._syncFromAttrs()\n\n if (!this._isNativeButton) {\n if (!this.hasAttribute('role')) this.setAttribute('role', 'button')\n if (!this.hasAttribute('tabindex')) this.setAttribute('tabindex', '0')\n this.addEventListener('keydown', this._onKeydown)\n }\n // Suppress activation when disabled (capture so it beats consumer handlers).\n this.addEventListener('click', this._onClickCapture, true)\n\n // Inherit disabled from a FormControlContext ancestor, if any.\n try {\n this._inheritedDisabled = injectValue(this, formControlContext).disabled\n } catch {\n this._inheritedDisabled = null\n }\n\n this._disposers.push(\n effect(() => {\n const disabled = this._effectiveDisabled()\n if (disabled) this.setAttribute('aria-disabled', 'true')\n else this.removeAttribute('aria-disabled')\n\n if (this._isToggle) {\n this.setAttribute('aria-pressed', String(this._pressed[0]() === true))\n }\n this.setAttribute('data-state', this._stateString(disabled))\n }),\n )\n }\n\n disconnectedCallback(): void {\n this.removeEventListener('keydown', this._onKeydown)\n this.removeEventListener('click', this._onClickCapture, true)\n for (const d of this._disposers) d()\n this._disposers = []\n }\n\n attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n switch (name) {\n case 'disabled':\n this._disabled[1](value !== null)\n break\n case 'pressed':\n this._isToggle = value !== null ? true : this._isToggle\n this._pressed[1](value !== null)\n break\n }\n }\n\n /** Toggle a toggle-button's pressed state. */\n toggle(): void {\n if (!this._isToggle) return\n this._pressed[1](!(this._pressed[0]() === true))\n }\n\n private _effectiveDisabled(): boolean {\n if (this._disabled[0]()) return true\n return this._inheritedDisabled ? this._inheritedDisabled() : false\n }\n\n private _stateString(disabled: boolean): string {\n if (disabled) return 'disabled'\n if (this._isToggle) return this._pressed[0]() === true ? 'on' : 'off'\n return 'idle'\n }\n\n private readonly _onKeydown = (ev: KeyboardEvent): void => {\n if (this._effectiveDisabled()) return\n if (ev.key === 'Enter' || ev.key === ' ' || ev.key === 'Spacebar') {\n ev.preventDefault()\n this.click()\n }\n }\n\n private readonly _onClickCapture = (ev: Event): void => {\n if (this._effectiveDisabled()) {\n ev.preventDefault()\n ev.stopImmediatePropagation()\n return\n }\n if (this._isToggle) this.toggle()\n }\n\n private _syncFromAttrs(): void {\n this._disabled[1](this.hasAttribute('disabled'))\n if (this._isToggle) this._pressed[1](this.getAttribute('pressed') !== 'false')\n }\n}\n\n/** Register a concrete button tag backed by `AihuButton` (idempotent). */\nexport function defineButton(tag: string): typeof AihuButton {\n if (!customElements.get(tag)) {\n // A fresh subclass per tag so multiple tags can be registered.\n class TaggedButton extends AihuButton {}\n customElements.define(tag, TaggedButton)\n }\n return AihuButton\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,aAAb,cAAgC,YAAY;CAC1C,OAAgB,qBAAqB;EAAC;EAAY;EAAW;EAAO;CAEpE,YAA6B,OAAO,MAAM;CAC1C,WAA4B,OAAuB,KAAK;CACxD,qBAAmD;CACnD,aAAwC,EAAE;;CAG1C,YAAoB;CAEpB,IAAI,WAA0B;EAC5B,OAAO,KAAK,UAAU;;CAExB,IAAI,UAAgC;EAClC,OAAO,KAAK,SAAS;;CAGvB,IAAY,kBAA2B;EACrC,OAAO,KAAK,YAAY;;CAG1B,oBAA0B;EACxB,KAAK,YAAY,KAAK,aAAa,UAAU;EAC7C,KAAK,gBAAgB;EAErB,IAAI,CAAC,KAAK,iBAAiB;GACzB,IAAI,CAAC,KAAK,aAAa,OAAO,EAAE,KAAK,aAAa,QAAQ,SAAS;GACnE,IAAI,CAAC,KAAK,aAAa,WAAW,EAAE,KAAK,aAAa,YAAY,IAAI;GACtE,KAAK,iBA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WAAW,GAAG,QAAQ,OAAO,GAAG,QAAQ,YAAY;GACjE,GAAG,gBAAgB;GACnB,KAAK,OAAO;;;CAIhB,mBAAoC,OAAoB;EACtD,IAAI,KAAK,oBAAoB,EAAE;GAC7B,GAAG,gBAAgB;GACnB,GAAG,0BAA0B;GAC7B;;EAEF,IAAI,KAAK,WAAW,KAAK,QAAQ;;CAGnC,iBAA+B;EAC7B,KAAK,UAAU,GAAG,KAAK,aAAa,WAAW,CAAC;EAChD,IAAI,KAAK,WAAW,KAAK,SAAS,GAAG,KAAK,aAAa,UAAU,KAAK,QAAQ;;;;AAKlF,SAAgB,aAAa,KAAgC;CAC3D,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE;EAE5B,MAAM,qBAAqB,WAAW;EACtC,eAAe,OAAO,KAAK,aAAa;;CAE1C,OAAO"}
@@ -0,0 +1,2 @@
1
+ import { n as ButtonType, r as defineButton, t as AihuButton } from "./index-DPD4L6Nj.js";
2
+ export { AihuButton, ButtonType, defineButton };
package/dist/button.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as defineButton, t as AihuButton } from "./button-C-8c-A17.js";
2
+ export { AihuButton, defineButton };
@@ -0,0 +1,26 @@
1
+ import { DomContext } from "./dom-context.js";
2
+ import { Read } from "@aihu/signals";
3
+
4
+ //#region src/collection/index.d.ts
5
+ interface CollectionContextValue {
6
+ /** Register `el`; returns a disposer that unregisters it. */
7
+ register(el: Element): () => void;
8
+ /** Registered descendants, kept in DOM order. */
9
+ readonly items: Read<Element[]>;
10
+ }
11
+ declare const collectionContext: DomContext<CollectionContextValue>;
12
+ /** The registration mechanism, usable standalone (roving-focus reuses it). */
13
+ declare function createCollection(): CollectionContextValue;
14
+ declare class AihuCollection extends HTMLElement {
15
+ private readonly _collection;
16
+ /** Registered descendants in DOM order. */
17
+ get items(): Read<Element[]>;
18
+ /** Register `el` into this collection; returns an unregister disposer. */
19
+ register(el: Element): () => void;
20
+ constructor();
21
+ }
22
+ /** Register `<aihu-collection>` (idempotent). */
23
+ declare function defineCollection(tag?: string): void;
24
+ //#endregion
25
+ export { AihuCollection, CollectionContextValue, collectionContext, createCollection, defineCollection };
26
+ //# sourceMappingURL=collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.d.ts","names":[],"sources":["../src/collection/index.ts"],"mappings":";;;;UAeiB,sBAAA;EAEF;EAAb,QAAA,CAAS,EAAA,EAAI,OAAA;EAEJ;EAAA,SAAA,KAAA,EAAO,IAAA,CAAK,OAAA;AAAA;AAAA,cAGV,iBAAA,EAAiB,UAAA,CAAA,sBAAA;;iBAad,gBAAA,CAAA,GAAoB,sBAAA;AAAA,cAmBvB,cAAA,SAAuB,WAAA;EAAA,iBACjB,WAAA;EAjCW;EAAA,IAoCxB,KAAA,CAAA,GAAS,IAAA,CAAK,OAAA;EAvBJ;EA4Bd,QAAA,CAAS,EAAA,EAAI,OAAA;;;;iBAYC,gBAAA,CAAiB,GAAA"}
@@ -0,0 +1,72 @@
1
+ import { createDomContext, provideContext } from "./dom-context.js";
2
+ import { signal } from "@aihu/signals";
3
+ //#region src/collection/index.ts
4
+ /**
5
+ * `<aihu-collection>` — descendant-registration substrate (the Radix
6
+ * `Collection` pattern) implemented over the DOM-walk context. Descendants call
7
+ * `register(el)` on connect (getting back an unregister disposer for
8
+ * disconnect); the collection keeps its `items` signal in DOM order. The
9
+ * substrate `roving-focus`, menu-style, and future list primitives build on.
10
+ * Structural — no ARIA, no CSS.
11
+ *
12
+ * Owned signals: `items` — ordered signal array of registered descendants.
13
+ * Context: provides `collectionContext` exposing `{ register, items }`.
14
+ */
15
+ const collectionContext = createDomContext("collection");
16
+ /** Sort a set of elements into DOM (document) order. */
17
+ function sortDomOrder(els) {
18
+ return [...els].sort((a, b) => {
19
+ const rel = a.compareDocumentPosition(b);
20
+ if (rel & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
21
+ if (rel & Node.DOCUMENT_POSITION_PRECEDING) return 1;
22
+ return 0;
23
+ });
24
+ }
25
+ /** The registration mechanism, usable standalone (roving-focus reuses it). */
26
+ function createCollection() {
27
+ const members = /* @__PURE__ */ new Set();
28
+ const [items, setItems] = signal([]);
29
+ const resync = () => {
30
+ setItems(sortDomOrder(members));
31
+ };
32
+ return {
33
+ items,
34
+ register(el) {
35
+ members.add(el);
36
+ resync();
37
+ return () => {
38
+ members.delete(el);
39
+ resync();
40
+ };
41
+ }
42
+ };
43
+ }
44
+ var AihuCollection = class extends HTMLElement {
45
+ _collection = createCollection();
46
+ /** Registered descendants in DOM order. */
47
+ get items() {
48
+ return this._collection.items;
49
+ }
50
+ /** Register `el` into this collection; returns an unregister disposer. */
51
+ register(el) {
52
+ return this._collection.register(el);
53
+ }
54
+ constructor() {
55
+ super();
56
+ provideContext(this, collectionContext, this._collection);
57
+ }
58
+ };
59
+ let _defined = false;
60
+ /** Register `<aihu-collection>` (idempotent). */
61
+ function defineCollection(tag = "aihu-collection") {
62
+ if (_defined || customElements.get(tag)) {
63
+ _defined = true;
64
+ return;
65
+ }
66
+ customElements.define(tag, AihuCollection);
67
+ _defined = true;
68
+ }
69
+ //#endregion
70
+ export { AihuCollection, collectionContext, createCollection, defineCollection };
71
+
72
+ //# sourceMappingURL=collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.js","names":[],"sources":["../src/collection/index.ts"],"sourcesContent":["/**\n * `<aihu-collection>` — descendant-registration substrate (the Radix\n * `Collection` pattern) implemented over the DOM-walk context. Descendants call\n * `register(el)` on connect (getting back an unregister disposer for\n * disconnect); the collection keeps its `items` signal in DOM order. The\n * substrate `roving-focus`, menu-style, and future list primitives build on.\n * Structural — no ARIA, no CSS.\n *\n * Owned signals: `items` — ordered signal array of registered descendants.\n * Context: provides `collectionContext` exposing `{ register, items }`.\n */\n\nimport { type Read, signal } from '@aihu/signals'\nimport { createDomContext, provideContext } from '../dom-context.ts'\n\nexport interface CollectionContextValue {\n /** Register `el`; returns a disposer that unregisters it. */\n register(el: Element): () => void\n /** Registered descendants, kept in DOM order. */\n readonly items: Read<Element[]>\n}\n\nexport const collectionContext = createDomContext<CollectionContextValue>('collection')\n\n/** Sort a set of elements into DOM (document) order. */\nfunction sortDomOrder(els: Set<Element>): Element[] {\n return [...els].sort((a, b) => {\n const rel = a.compareDocumentPosition(b)\n if (rel & Node.DOCUMENT_POSITION_FOLLOWING) return -1\n if (rel & Node.DOCUMENT_POSITION_PRECEDING) return 1\n return 0\n })\n}\n\n/** The registration mechanism, usable standalone (roving-focus reuses it). */\nexport function createCollection(): CollectionContextValue {\n const members = new Set<Element>()\n const [items, setItems] = signal<Element[]>([])\n const resync = (): void => {\n setItems(sortDomOrder(members))\n }\n return {\n items,\n register(el: Element): () => void {\n members.add(el)\n resync()\n return () => {\n members.delete(el)\n resync()\n }\n },\n }\n}\n\nexport class AihuCollection extends HTMLElement {\n private readonly _collection = createCollection()\n\n /** Registered descendants in DOM order. */\n get items(): Read<Element[]> {\n return this._collection.items\n }\n\n /** Register `el` into this collection; returns an unregister disposer. */\n register(el: Element): () => void {\n return this._collection.register(el)\n }\n\n constructor() {\n super()\n provideContext(this, collectionContext, this._collection)\n }\n}\n\nlet _defined = false\n/** Register `<aihu-collection>` (idempotent). */\nexport function defineCollection(tag = 'aihu-collection'): void {\n if (_defined || customElements.get(tag)) {\n _defined = true\n return\n }\n customElements.define(tag, AihuCollection)\n _defined = true\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAa,oBAAoB,iBAAyC,aAAa;;AAGvF,SAAS,aAAa,KAA8B;CAClD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM;EAC7B,MAAM,MAAM,EAAE,wBAAwB,EAAE;EACxC,IAAI,MAAM,KAAK,6BAA6B,OAAO;EACnD,IAAI,MAAM,KAAK,6BAA6B,OAAO;EACnD,OAAO;GACP;;;AAIJ,SAAgB,mBAA2C;CACzD,MAAM,0BAAU,IAAI,KAAc;CAClC,MAAM,CAAC,OAAO,YAAY,OAAkB,EAAE,CAAC;CAC/C,MAAM,eAAqB;EACzB,SAAS,aAAa,QAAQ,CAAC;;CAEjC,OAAO;EACL;EACA,SAAS,IAAyB;GAChC,QAAQ,IAAI,GAAG;GACf,QAAQ;GACR,aAAa;IACX,QAAQ,OAAO,GAAG;IAClB,QAAQ;;;EAGb;;AAGH,IAAa,iBAAb,cAAoC,YAAY;CAC9C,cAA+B,kBAAkB;;CAGjD,IAAI,QAAyB;EAC3B,OAAO,KAAK,YAAY;;;CAI1B,SAAS,IAAyB;EAChC,OAAO,KAAK,YAAY,SAAS,GAAG;;CAGtC,cAAc;EACZ,OAAO;EACP,eAAe,MAAM,mBAAmB,KAAK,YAAY;;;AAI7D,IAAI,WAAW;;AAEf,SAAgB,iBAAiB,MAAM,mBAAyB;CAC9D,IAAI,YAAY,eAAe,IAAI,IAAI,EAAE;EACvC,WAAW;EACX;;CAEF,eAAe,OAAO,KAAK,eAAe;CAC1C,WAAW"}
@@ -0,0 +1,39 @@
1
+ import { DomContext } from "./dom-context.js";
2
+ import { Read } from "@aihu/signals";
3
+
4
+ //#region src/config-provider/index.d.ts
5
+ type ColorScheme = 'light' | 'dark' | 'system';
6
+ type Density = 'comfortable' | 'compact';
7
+ type Direction = 'ltr' | 'rtl';
8
+ interface ConfigContextValue {
9
+ readonly colorScheme: Read<ColorScheme>;
10
+ readonly density: Read<Density>;
11
+ readonly dir: Read<Direction>;
12
+ }
13
+ declare const configContext: DomContext<ConfigContextValue>;
14
+ declare class AihuConfigProvider extends HTMLElement {
15
+ static readonly observedAttributes: string[];
16
+ private readonly _colorScheme;
17
+ private readonly _density;
18
+ private readonly _dir;
19
+ private _disposers;
20
+ get colorScheme(): Read<ColorScheme>;
21
+ get density(): Read<Density>;
22
+ /** The direction signal. Named `dirSignal` to avoid clobbering the native
23
+ * `HTMLElement.dir` string property (which this element still reflects). */
24
+ get dirSignal(): Read<Direction>;
25
+ constructor();
26
+ connectedCallback(): void;
27
+ disconnectedCallback(): void;
28
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
29
+ /** Imperative setters (consumers may drive config from JS, not just attrs). */
30
+ setColorScheme(v: ColorScheme): void;
31
+ setDensity(v: Density): void;
32
+ setDir(v: Direction): void;
33
+ private _syncFromAttrs;
34
+ }
35
+ /** Register `<aihu-config-provider>` (idempotent). */
36
+ declare function defineConfigProvider(tag?: string): void;
37
+ //#endregion
38
+ export { AihuConfigProvider, ColorScheme, ConfigContextValue, Density, Direction, configContext, defineConfigProvider };
39
+ //# sourceMappingURL=config-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-provider.d.ts","names":[],"sources":["../src/config-provider/index.ts"],"mappings":";;;;KAmBY,WAAA;AAAA,KACA,OAAA;AAAA,KACA,SAAA;AAAA,UAEK,kBAAA;EAAA,SACN,WAAA,EAAa,IAAA,CAAK,WAAA;EAAA,SAClB,OAAA,EAAS,IAAA,CAAK,OAAA;EAAA,SACd,GAAA,EAAK,IAAA,CAAK,SAAA;AAAA;AAAA,cAGR,aAAA,EAAa,UAAA,CAAA,kBAAA;AAAA,cAEb,kBAAA,SAA2B,WAAA;EAAA,gBACtB,kBAAA;EAAA,iBAEC,YAAA;EAAA,iBACA,QAAA;EAAA,iBACA,IAAA;EAAA,QAET,UAAA;EAAA,IAEJ,WAAA,CAAA,GAAe,IAAA,CAAK,WAAA;EAAA,IAGpB,OAAA,CAAA,GAAW,IAAA,CAAK,OAAA;EAlBX;;EAAA,IAuBL,SAAA,CAAA,GAAa,IAAA,CAAK,SAAA;;EAatB,iBAAA,CAAA;EAYA,oBAAA,CAAA;EAKA,wBAAA,CAAyB,IAAA,UAAc,IAAA,iBAAqB,KAAA;EApDhC;EAmE5B,cAAA,CAAe,CAAA,EAAG,WAAA;EAGlB,UAAA,CAAW,CAAA,EAAG,OAAA;EAGd,MAAA,CAAO,CAAA,EAAG,SAAA;EAAA,QAIF,cAAA;AAAA;AAxEV;AAAA,iBA2FgB,oBAAA,CAAqB,GAAA"}
@@ -0,0 +1,112 @@
1
+ import { createDomContext, provideContext } from "./dom-context.js";
2
+ import { effect, signal } from "@aihu/signals";
3
+ //#region src/config-provider/index.ts
4
+ /**
5
+ * `<aihu-config-provider>` — app-level config propagated via reactive DOM
6
+ * context. The canonical signal-composition demonstrator: descendants inject
7
+ * `configContext` and read the signals inside an `effect()` so they react to
8
+ * config changes (e.g. a tooltip reading `dir` to flip placement). Emits NO CSS
9
+ * — it only sets host attributes the CSS engine's variants resolve against.
10
+ *
11
+ * Reflected attributes: `color-scheme` (`"light" | "dark" | "system"`),
12
+ * `density` (`"comfortable" | "compact"`), `dir` (`"ltr" | "rtl"`).
13
+ * Owned signals: `colorScheme`, `density`, `dir`.
14
+ * Context: provides `configContext` carrying the three signals; nearest-wins
15
+ * for nested providers.
16
+ * DOM: reflects `dir`, `data-density`, `data-color-scheme` onto the host so the
17
+ * engine's `host-context-dark:` variant + density tokens resolve.
18
+ */
19
+ const configContext = createDomContext("config");
20
+ var AihuConfigProvider = class extends HTMLElement {
21
+ static observedAttributes = [
22
+ "color-scheme",
23
+ "density",
24
+ "dir"
25
+ ];
26
+ _colorScheme = signal("system");
27
+ _density = signal("comfortable");
28
+ _dir = signal("ltr");
29
+ _disposers = [];
30
+ get colorScheme() {
31
+ return this._colorScheme[0];
32
+ }
33
+ get density() {
34
+ return this._density[0];
35
+ }
36
+ /** The direction signal. Named `dirSignal` to avoid clobbering the native
37
+ * `HTMLElement.dir` string property (which this element still reflects). */
38
+ get dirSignal() {
39
+ return this._dir[0];
40
+ }
41
+ constructor() {
42
+ super();
43
+ provideContext(this, configContext, {
44
+ colorScheme: this._colorScheme[0],
45
+ density: this._density[0],
46
+ dir: this._dir[0]
47
+ });
48
+ }
49
+ connectedCallback() {
50
+ this._syncFromAttrs();
51
+ this._disposers.push(effect(() => {
52
+ this.setAttribute("data-color-scheme", this._colorScheme[0]());
53
+ this.setAttribute("data-density", this._density[0]());
54
+ this.setAttribute("dir", this._dir[0]());
55
+ }));
56
+ }
57
+ disconnectedCallback() {
58
+ for (const d of this._disposers) d();
59
+ this._disposers = [];
60
+ }
61
+ attributeChangedCallback(name, _old, value) {
62
+ switch (name) {
63
+ case "color-scheme":
64
+ if (isColorScheme(value)) this._colorScheme[1](value);
65
+ break;
66
+ case "density":
67
+ if (isDensity(value)) this._density[1](value);
68
+ break;
69
+ case "dir":
70
+ if (value === "ltr" || value === "rtl") this._dir[1](value);
71
+ break;
72
+ }
73
+ }
74
+ /** Imperative setters (consumers may drive config from JS, not just attrs). */
75
+ setColorScheme(v) {
76
+ this._colorScheme[1](v);
77
+ }
78
+ setDensity(v) {
79
+ this._density[1](v);
80
+ }
81
+ setDir(v) {
82
+ this._dir[1](v);
83
+ }
84
+ _syncFromAttrs() {
85
+ const cs = this.getAttribute("color-scheme");
86
+ if (isColorScheme(cs)) this._colorScheme[1](cs);
87
+ const d = this.getAttribute("density");
88
+ if (isDensity(d)) this._density[1](d);
89
+ const dir = this.getAttribute("dir");
90
+ if (dir === "ltr" || dir === "rtl") this._dir[1](dir);
91
+ }
92
+ };
93
+ function isColorScheme(v) {
94
+ return v === "light" || v === "dark" || v === "system";
95
+ }
96
+ function isDensity(v) {
97
+ return v === "comfortable" || v === "compact";
98
+ }
99
+ let _defined = false;
100
+ /** Register `<aihu-config-provider>` (idempotent). */
101
+ function defineConfigProvider(tag = "aihu-config-provider") {
102
+ if (_defined || customElements.get(tag)) {
103
+ _defined = true;
104
+ return;
105
+ }
106
+ customElements.define(tag, AihuConfigProvider);
107
+ _defined = true;
108
+ }
109
+ //#endregion
110
+ export { AihuConfigProvider, configContext, defineConfigProvider };
111
+
112
+ //# sourceMappingURL=config-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-provider.js","names":[],"sources":["../src/config-provider/index.ts"],"sourcesContent":["/**\n * `<aihu-config-provider>` — app-level config propagated via reactive DOM\n * context. The canonical signal-composition demonstrator: descendants inject\n * `configContext` and read the signals inside an `effect()` so they react to\n * config changes (e.g. a tooltip reading `dir` to flip placement). Emits NO CSS\n * — it only sets host attributes the CSS engine's variants resolve against.\n *\n * Reflected attributes: `color-scheme` (`\"light\" | \"dark\" | \"system\"`),\n * `density` (`\"comfortable\" | \"compact\"`), `dir` (`\"ltr\" | \"rtl\"`).\n * Owned signals: `colorScheme`, `density`, `dir`.\n * Context: provides `configContext` carrying the three signals; nearest-wins\n * for nested providers.\n * DOM: reflects `dir`, `data-density`, `data-color-scheme` onto the host so the\n * engine's `host-context-dark:` variant + density tokens resolve.\n */\n\nimport { effect, type Read, signal } from '@aihu/signals'\nimport { createDomContext, provideContext } from '../dom-context.ts'\n\nexport type ColorScheme = 'light' | 'dark' | 'system'\nexport type Density = 'comfortable' | 'compact'\nexport type Direction = 'ltr' | 'rtl'\n\nexport interface ConfigContextValue {\n readonly colorScheme: Read<ColorScheme>\n readonly density: Read<Density>\n readonly dir: Read<Direction>\n}\n\nexport const configContext = createDomContext<ConfigContextValue>('config')\n\nexport class AihuConfigProvider extends HTMLElement {\n static readonly observedAttributes = ['color-scheme', 'density', 'dir']\n\n private readonly _colorScheme = signal<ColorScheme>('system')\n private readonly _density = signal<Density>('comfortable')\n private readonly _dir = signal<Direction>('ltr')\n\n private _disposers: Array<() => void> = []\n\n get colorScheme(): Read<ColorScheme> {\n return this._colorScheme[0]\n }\n get density(): Read<Density> {\n return this._density[0]\n }\n /** The direction signal. Named `dirSignal` to avoid clobbering the native\n * `HTMLElement.dir` string property (which this element still reflects). */\n get dirSignal(): Read<Direction> {\n return this._dir[0]\n }\n\n constructor() {\n super()\n provideContext(this, configContext, {\n colorScheme: this._colorScheme[0],\n density: this._density[0],\n dir: this._dir[0],\n })\n }\n\n connectedCallback(): void {\n this._syncFromAttrs()\n // Reflect config onto host attributes the CSS engine targets.\n this._disposers.push(\n effect(() => {\n this.setAttribute('data-color-scheme', this._colorScheme[0]())\n this.setAttribute('data-density', this._density[0]())\n this.setAttribute('dir', this._dir[0]())\n }),\n )\n }\n\n disconnectedCallback(): void {\n for (const d of this._disposers) d()\n this._disposers = []\n }\n\n attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n switch (name) {\n case 'color-scheme':\n if (isColorScheme(value)) this._colorScheme[1](value)\n break\n case 'density':\n if (isDensity(value)) this._density[1](value)\n break\n case 'dir':\n if (value === 'ltr' || value === 'rtl') this._dir[1](value)\n break\n }\n }\n\n /** Imperative setters (consumers may drive config from JS, not just attrs). */\n setColorScheme(v: ColorScheme): void {\n this._colorScheme[1](v)\n }\n setDensity(v: Density): void {\n this._density[1](v)\n }\n setDir(v: Direction): void {\n this._dir[1](v)\n }\n\n private _syncFromAttrs(): void {\n const cs = this.getAttribute('color-scheme')\n if (isColorScheme(cs)) this._colorScheme[1](cs)\n const d = this.getAttribute('density')\n if (isDensity(d)) this._density[1](d)\n const dir = this.getAttribute('dir')\n if (dir === 'ltr' || dir === 'rtl') this._dir[1](dir)\n }\n}\n\nfunction isColorScheme(v: string | null): v is ColorScheme {\n return v === 'light' || v === 'dark' || v === 'system'\n}\nfunction isDensity(v: string | null): v is Density {\n return v === 'comfortable' || v === 'compact'\n}\n\nlet _defined = false\n/** Register `<aihu-config-provider>` (idempotent). */\nexport function defineConfigProvider(tag = 'aihu-config-provider'): void {\n if (_defined || customElements.get(tag)) {\n _defined = true\n return\n }\n customElements.define(tag, AihuConfigProvider)\n _defined = true\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,MAAa,gBAAgB,iBAAqC,SAAS;AAE3E,IAAa,qBAAb,cAAwC,YAAY;CAClD,OAAgB,qBAAqB;EAAC;EAAgB;EAAW;EAAM;CAEvE,eAAgC,OAAoB,SAAS;CAC7D,WAA4B,OAAgB,cAAc;CAC1D,OAAwB,OAAkB,MAAM;CAEhD,aAAwC,EAAE;CAE1C,IAAI,cAAiC;EACnC,OAAO,KAAK,aAAa;;CAE3B,IAAI,UAAyB;EAC3B,OAAO,KAAK,SAAS;;;;CAIvB,IAAI,YAA6B;EAC/B,OAAO,KAAK,KAAK;;CAGnB,cAAc;EACZ,OAAO;EACP,eAA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