@adia-ai/web-components 0.7.12 → 0.7.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog — @adia-ai/web-components
2
2
 
3
+ ## [0.7.14] — 2026-06-08
4
+
5
+ ### Fixed
6
+ - **`input-ui`/`textarea-ui` `.value` property binding set before upgrade is no longer dropped.** A `.value=${x}` (or any reactive property) assigned during template stamp *before* the element upgrades landed as a pre-upgrade own data-property that `installProps`' `Object.defineProperty` clobbered with the signal default — so the field rendered blank while `value="${x}"` (attribute) worked, and `<select-ui>` was unaffected (inconsistent). `installProps` now captures + reifies the pre-upgrade value (WHATWG upgrade-a-property pattern), fixing it for `value` and every UIElement property. (color-app FEEDBACK-99; covered by `core/element.test.js`.)
7
+
8
+ ## [0.7.13] — 2026-06-06
9
+
10
+ ### Fixed
11
+ - **`./css/sheet` subpath export now resolves TS types.** The 0.7.12 `.sheet.js` twin (constructable-`CSSStyleSheet` mirror of `web-components.min.css`) shipped its `./css/sheet` export with `import`/`default` but no `types` — TS consumers got no types for `constructSheet()`. Added `web-components.sheet.d.ts` (`export function constructSheet(): CSSStyleSheet | null`), the `types` condition (types-first), and the `.d.ts` to `files[]` so the tarball packs it. Caught by `verify:exports-conditionals`.
12
+ - **`button-ui[color=warning]` hover contrast** — the warning fill's hover surface now uses `--a-warning-bg` (the -20 tint) instead of `--a-warning-strong`, whose mid-tone read muddy under the dark `--a-warning-fg`. Demo (`theme-provider.html`) card header wrapped in `<header>` for canonical structure. (dogfood-audit: warning-strong-vs-bg; check:card-structure.)
13
+
14
+ ### Docs
15
+ - README CDN snippets refreshed to the current line: `@0.6` → `@0.7`, primitive count 95 → 122, pin example → `@adia-ai/web-components@0.7.13`.
16
+
3
17
  ## [0.7.12] — 2026-06-04
4
18
 
5
19
  ### Added
@@ -3002,7 +3016,7 @@ The future non-side-effect `class` subpath per component (allowing class import
3002
3016
 
3003
3017
  All `change` / `input` event dispatches across form-bearing components now emit a `CustomEvent` carrying `detail: { value: this.value }` (value-semantic primitives) or `detail: { value: this.value, checked: this.checked }` (boolean-semantic — switch / check / radio / option-card). Backwards-compatible — `e.target.value` still works since the host's `value` property is updated before dispatch.
3004
3018
 
3005
- Driven by [consumer feedback](/Users/kimba/Projects/adia/color-app/docs/outbound/FEEDBACK-adia-packages.md) from Design Tokens Studio (2026-05-12) — eliminates the `(e.target as any).value` pattern in TypeScript consumers.
3019
+ Driven by consumer feedback from Design Tokens Studio (2026-05-12) — eliminates the `(e.target as any).value` pattern in TypeScript consumers.
3006
3020
 
3007
3021
  **Value-semantic primitives swept** (`detail: { value }`):
3008
3022
  - `<input-ui>` (input.js — 9 dispatch sites)
@@ -3208,7 +3222,7 @@ Lockstep version bump only — source byte-identical to v0.3.4. Internal `@adia-
3208
3222
  Lockstep version bump only — source byte-identical to v0.3.3. Internal `@adia-ai/*` dep ranges remain at `^0.3.0`. See root [CHANGELOG.md `## [0.3.4]`](../../CHANGELOG.md) for the cut narrative.
3209
3223
  ## [0.3.3] - 2026-05-07
3210
3224
 
3211
- **Lockstep cut.** All 9 published `@adia-ai/*` packages now share version `0.3.3`, governed by [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy).
3225
+ **Lockstep cut.** All 9 published `@adia-ai/*` packages now share version `0.3.3`, governed by [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
3212
3226
 
3213
3227
  ### Changed
3214
3228
 
@@ -3221,7 +3235,7 @@ Lockstep version bump only — source byte-identical to v0.3.3. Internal `@adia-
3221
3235
  ## [0.3.2] - 2026-05-06
3222
3236
 
3223
3237
  **9-package lockstep patch cut to v0.3.2.** All lockstep members share
3224
- one version per [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy).
3238
+ one version per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy).
3225
3239
  Internal `@adia-ai/*` dep ranges unchanged at `^0.3.0`.
3226
3240
 
3227
3241
  ### No source changes
package/README.md CHANGED
@@ -38,13 +38,13 @@ Since **v0.6.30**, this package ships pre-flattened + minified bundles under `di
38
38
 
39
39
  ```html
40
40
  <!-- CSS: all primitives, tokens, resets (443 KB raw / ~50 KB gzipped) -->
41
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.6/dist/web-components.min.css">
41
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.7/dist/web-components.min.css">
42
42
 
43
- <!-- JS: registers all 95 primitives (~250 KB gzipped via Brotli) -->
44
- <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.6/dist/web-components.min.js"></script>
43
+ <!-- JS: registers all 122 primitives (~250 KB gzipped via Brotli) -->
44
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@adia-ai/web-components@0.7/dist/web-components.min.js"></script>
45
45
  ```
46
46
 
47
- The `@0.6` range tracks the latest `0.6.x` patch automatically (won't jump to a breaking `0.7`). For reproducible builds, pin an exact version instead — e.g. `@adia-ai/web-components@0.6.45/dist/web-components.min.css`.
47
+ The `@0.7` range tracks the latest `0.6.x` patch automatically (won't jump to a breaking `0.8`). For reproducible builds, pin an exact version instead — e.g. `@adia-ai/web-components@0.7.13/dist/web-components.min.css`.
48
48
 
49
49
  For composite shells, add the corresponding bundle from `@adia-ai/web-modules` — see [its README](../web-modules/#cdn-no-bundler--codepen-marketing-pages-static-html) or the [CDN usage guide](https://ui-kit.exe.xyz/site/cdn-usage). The kitchen-sink path is `@adia-ai/web-modules/dist/everything.min.js` (all primitives + all 4 shells; ~190 KB gzipped) — one tag for CodePen demos.
50
50
 
@@ -59,7 +59,7 @@ For composite shells, add the corresponding bundle from `@adia-ai/web-modules`
59
59
  ESM-only — bundlers (Vite, esbuild, webpack 5+, Rollup) resolve `import` for both `.js` and `.css`; in plain HTML use `<script type="module">` + `<link rel="stylesheet">`.
60
60
 
61
61
  ```js
62
- import '@adia-ai/web-components'; // registers every *-ui tag (95 primitives)
62
+ import '@adia-ai/web-components'; // registers every *-ui tag (122 primitives)
63
63
  import '@adia-ai/web-components/css'; // every primitive's CSS (one stylesheet)
64
64
  ```
65
65
 
@@ -23,9 +23,10 @@ button-ui[variant="primary"]:not([disabled]):hover { --button-bg: var(--a-accent
23
23
  button-ui[color="danger"]:not([disabled]):hover { --button-bg: var(--a-danger-strong); }
24
24
  button-ui[color="success"]:not([disabled]):hover { --button-bg: var(--a-success-strong); }
25
25
  button-ui[color="info"]:not([disabled]):hover { --button-bg: var(--a-info-strong); }
26
- /* warning fill → -strong like the rest; its mid-tone can read muddy under
27
- the dark --a-warning-fg revisit the warning ramp upstream if so. */
28
- button-ui[color="warning"]:not([disabled]):hover { --button-bg: var(--a-warning-strong); }
26
+ /* warning fill → -bg (NOT -strong like the rest): warning's -strong mid-tone
27
+ reads muddy under the dark --a-warning-fg, so the hover surface uses the
28
+ -20 tint (--a-warning-bg) for clean contrast. (dogfood-audit: warning-strong-vs-bg) */
29
+ button-ui[color="warning"]:not([disabled]):hover { --button-bg: var(--a-warning-bg); }
29
30
 
30
31
  /* Outline / ghost — no fill on hover; fg goes rest-color → `-strong`.
31
32
  Ghost reads --button-fg-ghost-hover (default --a-fg-strong) so consumers
@@ -52,7 +52,17 @@
52
52
  "Modal",
53
53
  "Col"
54
54
  ],
55
- "slots": {},
55
+ "slots": {
56
+ "body": {
57
+ "description": "The scrolling region — the only one with overflow. The native `<section>` child takes this role by tag + DOM order; any element can opt in via `slot=\"body\"`. Scrolls between the pinned header and footer (requires a definite-height parent)."
58
+ },
59
+ "footer": {
60
+ "description": "Pinned bottom region — typically an action bar kept visible while the body scrolls. The native `<footer>` child takes this role by tag + DOM order; any element can opt in via `slot=\"footer\"`. Optional."
61
+ },
62
+ "header": {
63
+ "description": "Pinned top region — stays fixed while the body scrolls. The native `<header>` child takes this role by tag + DOM order; any element can opt in via `slot=\"header\"` (a CSS [slot] match in Light DOM, not native projection — ADR-0033), e.g. `<section slot=\"header\">` as a pinned rail. Optional."
64
+ }
65
+ },
56
66
  "states": [
57
67
  {
58
68
  "description": "Default, ready for interaction.",
@@ -25,7 +25,25 @@ description: |
25
25
  not broken).
26
26
  props: {}
27
27
  events: {}
28
- slots: {}
28
+ slots:
29
+ header:
30
+ description: >-
31
+ Pinned top region — stays fixed while the body scrolls. The native
32
+ `<header>` child takes this role by tag + DOM order; any element can opt
33
+ in via `slot="header"` (a CSS [slot] match in Light DOM, not native
34
+ projection — ADR-0033), e.g. `<section slot="header">` as a pinned rail.
35
+ Optional.
36
+ body:
37
+ description: >-
38
+ The scrolling region — the only one with overflow. The native `<section>`
39
+ child takes this role by tag + DOM order; any element can opt in via
40
+ `slot="body"`. Scrolls between the pinned header and footer (requires a
41
+ definite-height parent).
42
+ footer:
43
+ description: >-
44
+ Pinned bottom region — typically an action bar kept visible while the body
45
+ scrolls. The native `<footer>` child takes this role by tag + DOM order;
46
+ any element can opt in via `slot="footer"`. Optional.
29
47
  states:
30
48
  - name: idle
31
49
  description: Default, ready for interaction.
package/core/element.js CHANGED
@@ -34,6 +34,19 @@ function installProps(el, props) {
34
34
  for (const [key, cfg] of Object.entries(props)) {
35
35
  const attr = cfg.attribute ?? key.toLowerCase();
36
36
  const type = cfg.type ?? String;
37
+ // Lazy property upgrade: a property assigned on the instance BEFORE it
38
+ // upgraded (a template engine sets `.prop=${v}` during stamp — possibly
39
+ // before the element is defined; see the property-binding path in
40
+ // template.js which sets `el[name] = v` regardless of upgrade state)
41
+ // lives as an own data-property. The defineProperty below would clobber it
42
+ // with the signal default. Capture it and reify it into the signal so the
43
+ // value survives upgrade (WHATWG upgrade-a-property pattern). Fixes
44
+ // input-ui/textarea-ui `.value=${x}`. (A reflect:true prop set pre-upgrade
45
+ // reifies its value but won't update its attribute until the next set —
46
+ // setAttribute is a no-op in the upgrade constructor; a rare, fine corner.)
47
+ const hasPre = Object.prototype.hasOwnProperty.call(el, key);
48
+ const preValue = hasPre ? el[key] : undefined;
49
+ if (hasPre) delete el[key];
37
50
  const sig = signal(cfg.default ?? undefined);
38
51
  el[SIG].set(key, sig);
39
52
  Object.defineProperty(el, key, {
@@ -47,6 +60,7 @@ function installProps(el, props) {
47
60
  },
48
61
  configurable: true,
49
62
  });
63
+ if (hasPre) sig.value = preValue;
50
64
  }
51
65
  }
52
66
 
@@ -63,6 +63,23 @@ describe('UIElement — properties', () => {
63
63
  expect(el.label).toBe('hi');
64
64
  });
65
65
 
66
+ // FEEDBACK-99 (color-app, 2026-06-07): a property assigned on the instance
67
+ // BEFORE upgrade — template engines set `.prop=${v}` during stamp, possibly
68
+ // before the element is defined (see template.js property-binding path) —
69
+ // must survive upgrade, not be clobbered by the signal default. WHATWG
70
+ // "upgrade a property" pattern, here in installProps. Fixes input-ui `.value`.
71
+ it('reifies a property set on the instance before upgrade (lazy upgrade)', () => {
72
+ const tag = `test-el-${++registrationCounter}`;
73
+ const el = document.createElement(tag); // undefined tag → un-upgraded
74
+ document.body.appendChild(el);
75
+ el.value = 'pre-upgrade'; // own data-property, no accessor yet
76
+ class El extends UIElement {
77
+ static properties = { value: { type: String, default: '' } };
78
+ }
79
+ customElements.define(tag, El); // upgrade → installProps runs
80
+ expect(el.value).toBe('pre-upgrade'); // reified, not clobbered to ''
81
+ });
82
+
66
83
  it('reflects Boolean properties to HTML attributes when reflect: true', () => {
67
84
  class El extends UIElement {
68
85
  static properties = { disabled: { type: Boolean, default: false, reflect: true } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.7.12",
3
+ "version": "0.7.14",
4
4
  "description": "AdiaUI web components \u2014 vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-runtime.",
5
5
  "type": "module",
6
6
  "types": "./index.d.ts",
@@ -22,6 +22,7 @@
22
22
  "default": "./dist/web-components.min.css"
23
23
  },
24
24
  "./css/sheet": {
25
+ "types": "./web-components.sheet.d.ts",
25
26
  "import": "./dist/web-components.sheet.js",
26
27
  "default": "./dist/web-components.sheet.js"
27
28
  },
@@ -105,6 +106,7 @@
105
106
  "index.css",
106
107
  "index.d.ts",
107
108
  "css-module.d.ts",
109
+ "web-components.sheet.d.ts",
108
110
  "bin/",
109
111
  "custom-elements.json",
110
112
  "USAGE.md",
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Type declarations for the `@adia-ai/web-components/css/sheet` subpath — the
3
+ * constructable-`CSSStyleSheet` twin of `web-components.min.css` (byte-identical to the
4
+ * CDN bundle), adopted via `document.adoptedStyleSheets`.
5
+ */
6
+ export function constructSheet(): CSSStyleSheet | null;
7
+ export default constructSheet;