@adia-ai/web-components 0.7.10 → 0.7.11
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 +17 -1
- package/components/button/button.css +43 -16
- package/components/frame/frame.a2ui.json +1 -1
- package/components/frame/frame.css +9 -6
- package/components/frame/frame.d.ts +5 -3
- package/components/frame/frame.yaml +7 -5
- package/components/list/list.css +4 -0
- package/components/preview/preview.class.js +9 -0
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +1 -1
- package/package.json +1 -1
- package/styles/verse.css +1 -1
- package/traits/resizable/resizable.js +49 -36
- package/traits/resizable/resizable.test.js +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
# Changelog — @adia-ai/web-components
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [0.7.11] — 2026-06-04
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **`<frame-ui>` slot-override regions.** Beyond the native `<header>` / `<section>` / `<footer>` tags, any element can take a region role via `slot="header|body|footer"` (a CSS `[slot]` match — the same role-slot pattern as `<drawer-ui>`), so e.g. `<section slot="header">` is a pinned rail rather than the scroll body. The native tag stays the 90% sugar; reach for the slot when the element you want differs from the region role. Rail-slotted elements are `:not()`-excluded from the scroll-body selector, so a `[slot="header"]` section never doubles as the body. Files: `components/frame/{frame.css,frame.yaml,frame.html}`.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **`button-ui` hover now intensifies to the family `-strong` step.** Filled buttons strengthen their fill on hover — neutral → `--a-bg-strong`, `variant="primary"` → `--a-accent-strong`, and `color="danger|success|info|warning"` → the matching `--a-{family}-strong`. Outline + ghost keep a transparent fill and instead move the **fg** from its rest color to `-strong` (per-color outline/ghost shift to `--a-{family}-strong` text). This corrects a latent bug where `variant="primary"` and `color="danger"` hovered to the neutral `--a-ui-bg-hover` scrim (dropping their color), while `success` / `info` / `warning` and the neutral/default button had no hover-bg feedback at all. Note `-strong` resolves to the same step as `-active`/pressed, so the `:active` scale transform is what distinguishes press from hover. Override surfaces preserved: ghost hover still reads `--button-fg-ghost-hover` (alert.css retints it) and `--button-bg/border-ghost-hover` (the `component-tokens` demo opts a fill back in); the orphaned `--button-bg-hover-danger` token was removed. Warning's mid-tone `-strong` under dark `--a-warning-fg` may read muddy — flagged to revisit the warning ramp upstream. Files: `components/button/{button.css,button.examples.html}`.
|
|
12
|
+
- **`resizable` trait — corner handles + symmetric-from-center resize.** The trait gained 4 corner hit-zones (drag a corner to resize BOTH axes at once) on top of the 4 edges; each handle carries its axis signs (`dw`/`dh`) + cursor, and corners are layered last so they win the hit-test where they overlap an edge. Adds symmetric resize-from-center. Powers `<embed-shell traits="resizable">` and any resizable surface. Files: `traits/resizable/{resizable.js,resizable.examples.html}`.
|
|
13
|
+
- **CDN bundles rebuilt** — `dist/web-components.min.css` + `dist/web-components.min.js` regenerated so the `<frame-ui>` slot-override, the `button-ui` hover `-strong` step, the `resizable` corner handles, and the `list-item-ui` / `<preview-ui>` fixes reach `@adia-ai/web-components@0.7` CDN consumers.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **`list-item-ui` title vertical-centers with icon + action.** `[slot="text"]` lacked `align-self: center`, so when the action (e.g. a full-height `<button-ui>`) made row 1 taller than the title, the title top-aligned *above* the centered icon + action. All three row-1 cells now center together. Surfaced by `onboarding-checklist-ui` "Open" rows. File: `components/list/list.css`.
|
|
18
|
+
- **`<preview-ui>` code pane shows JSON attributes cleanly.** A JSON-bearing attribute (e.g. `items='[{"id":"a"}]'`) serializes via `outerHTML` as `items="[{"id"…}]"` — the `"` rendered literally in the code/copy pane, and `<code-ui>`’s Copy emitted entity-encoded source. `dedent()` now re-renders quote-bearing attribute values with single-quote delimiters (`items='[{"id":"a"}]'`) — the clean, valid, copy-paste-able form the author wrote (apostrophe-bearing values keep the escaped form, no safe single-char delimiter). File: `components/preview/preview.class.js`.
|
|
19
|
+
- **`[verse]` register radius comment corrected.** `styles/verse.css`'s `--a-radius-max: 0.75rem` carried a stale `/* 16px */` comment — `0.75rem` is 12px. Comment-only; no behavior change (the `0.75rem` max itself shipped in the 0.7.10 `[verse]` type bump). File: `styles/verse.css`.
|
|
4
20
|
|
|
5
21
|
## [0.7.10] — 2026-06-03
|
|
6
22
|
|
|
@@ -4,26 +4,54 @@
|
|
|
4
4
|
(0,1,1 / 0,2,1) is preserved. See docs/BROWSER-COMPAT.md §3a. */
|
|
5
5
|
button-ui:active { transform: scale(0.97); }
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/* ── Hover (re-points the component tokens; lives outside @scope —
|
|
8
|
+
Safari 17.x ignores :scope:hover at the scope root, see note above) ──
|
|
9
|
+
Filled variants intensify the fill to the family `-strong` step (the
|
|
10
|
+
deeper, higher-contrast step — note it equals the `-active`/pressed
|
|
11
|
+
step, so the :active transform above is what distinguishes press from
|
|
12
|
+
hover). Outline + ghost keep a transparent fill and instead move the
|
|
13
|
+
FG from its rest color to the matching `-strong` color. */
|
|
14
|
+
|
|
15
|
+
/* Neutral / default — fill → neutral `-strong` surface. Only --button-bg
|
|
16
|
+
moves: the rest fg (--a-fg-strong) and border (transparent) are already
|
|
17
|
+
the hover targets. The filled accent/semantic rules below re-point
|
|
18
|
+
--button-bg at higher specificity and leave each variant's rest fg
|
|
19
|
+
untouched (primary/danger/etc. keep their light label). */
|
|
20
|
+
button-ui:not([disabled]):hover { --button-bg: var(--button-bg-hover); }
|
|
21
|
+
|
|
22
|
+
button-ui[variant="primary"]:not([disabled]):hover { --button-bg: var(--a-accent-strong); }
|
|
23
|
+
button-ui[color="danger"]:not([disabled]):hover { --button-bg: var(--a-danger-strong); }
|
|
24
|
+
button-ui[color="success"]:not([disabled]):hover { --button-bg: var(--a-success-strong); }
|
|
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); }
|
|
29
|
+
|
|
30
|
+
/* Outline / ghost — no fill on hover; fg goes rest-color → `-strong`.
|
|
31
|
+
Ghost reads --button-fg-ghost-hover (default --a-fg-strong) so consumers
|
|
32
|
+
like alert.css can retint the ghost-hover label, and --button-bg/border-
|
|
33
|
+
ghost-hover (default transparent) so the component-tokens demo can opt a
|
|
34
|
+
fill back in. */
|
|
35
|
+
button-ui[variant="outline"]:not([disabled]):hover {
|
|
36
|
+
--button-bg: transparent;
|
|
10
37
|
--button-fg: var(--button-fg-hover);
|
|
11
|
-
--button-border: var(--button-border-hover);
|
|
12
38
|
}
|
|
13
39
|
button-ui[variant="ghost"]:not([disabled]):hover {
|
|
14
40
|
--button-bg: var(--button-bg-ghost-hover);
|
|
15
41
|
--button-fg: var(--button-fg-ghost-hover);
|
|
16
42
|
--button-border: var(--button-border-ghost-hover);
|
|
17
43
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
button-ui[color="danger"]:not([disabled]):hover
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
44
|
+
|
|
45
|
+
/* Per-color outline/ghost — fg → family `-strong` (specificity 0,4,1
|
|
46
|
+
clears the 0,3,0 [variant][color] rest combos inside @scope). */
|
|
47
|
+
button-ui[variant="outline"][color="danger"]:not([disabled]):hover,
|
|
48
|
+
button-ui[variant="ghost"][color="danger"]:not([disabled]):hover { --button-fg: var(--a-danger-strong); }
|
|
49
|
+
button-ui[variant="outline"][color="success"]:not([disabled]):hover,
|
|
50
|
+
button-ui[variant="ghost"][color="success"]:not([disabled]):hover { --button-fg: var(--a-success-strong); }
|
|
51
|
+
button-ui[variant="outline"][color="info"]:not([disabled]):hover,
|
|
52
|
+
button-ui[variant="ghost"][color="info"]:not([disabled]):hover { --button-fg: var(--a-info-strong); }
|
|
53
|
+
button-ui[variant="outline"][color="warning"]:not([disabled]):hover,
|
|
54
|
+
button-ui[variant="ghost"][color="warning"]:not([disabled]):hover { --button-fg: var(--a-warning-strong); }
|
|
27
55
|
|
|
28
56
|
@scope (button-ui) {
|
|
29
57
|
:where(:scope) {
|
|
@@ -41,7 +69,7 @@ button-ui[color="danger"]:not([disabled]):hover {
|
|
|
41
69
|
--button-font-weight: var(--a-ui-weight);
|
|
42
70
|
--button-font-family: var(--a-font-family-ui);
|
|
43
71
|
--button-gap: var(--a-space-1);
|
|
44
|
-
--button-bg-hover: var(--a-
|
|
72
|
+
--button-bg-hover: var(--a-bg-strong); /* neutral fill → neutral -strong surface on hover */
|
|
45
73
|
--button-fg-hover: var(--a-ui-text-hover);
|
|
46
74
|
--button-border-hover: transparent;
|
|
47
75
|
--button-bg-primary: var(--a-primary);
|
|
@@ -52,12 +80,11 @@ button-ui[color="danger"]:not([disabled]):hover {
|
|
|
52
80
|
--button-bg-ghost: transparent;
|
|
53
81
|
--button-fg-ghost: var(--a-fg-subtle);
|
|
54
82
|
--button-fg-ghost-hover: var(--a-fg-strong);
|
|
55
|
-
--button-bg-ghost-hover:
|
|
83
|
+
--button-bg-ghost-hover: transparent; /* ghost hover is fg-only; consumers/demo may override to add a fill */
|
|
56
84
|
--button-border-ghost: transparent;
|
|
57
85
|
--button-border-ghost-hover: transparent;
|
|
58
86
|
--button-bg-danger: var(--a-danger);
|
|
59
87
|
--button-fg-danger: var(--a-chrome-light); /* white on the saturated fill — see color rules */
|
|
60
|
-
--button-bg-hover-danger: var(--a-danger);
|
|
61
88
|
--button-bg-disabled: var(--a-ui-bg-disabled);
|
|
62
89
|
--button-fg-disabled: var(--a-ui-text-disabled);
|
|
63
90
|
--button-border-disabled: transparent;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://adiaui.dev/a2ui/v0_9/components/Frame.json",
|
|
4
4
|
"title": "Frame",
|
|
5
|
-
"description": "Sticky-header / scrolling-body / sticky-footer layout frame — the\nchrome-less app-shell skeleton. A flex column that fills its parent's\nblock size: a native <header> child pins to the top, a <footer> child\npins to the bottom, and the <section> child scrolls between them (the\nonly region with overflow).
|
|
5
|
+
"description": "Sticky-header / scrolling-body / sticky-footer layout frame — the\nchrome-less app-shell skeleton. A flex column that fills its parent's\nblock size: a native <header> child pins to the top, a <footer> child\npins to the bottom, and the <section> child scrolls between them (the\nonly region with overflow). Regions are positioned by tag + DOM order, OR any\nelement can take a region role via slot=\"header|body|footer\" (a CSS [slot] match,\nnot native projection — ADR-0033) — e.g. <section slot=\"header\"> as a pinned rail.\nAll three are OPTIONAL, so the common shape is just <section> + <footer>. Use for\ntab / panel content\nwhere actions stay visible while the body scrolls. Distinct from <card-ui>\n(adds border + elevation + a rich header grid), <drawer-ui> / <modal-ui>\n(add a backdrop + dismiss), and the page shells (<admin-page> / <page-ui>) —\nthose layer chrome over this same region contract. Requires a definite-height\nparent (a flex/grid chain rooted at a viewport height) for the section to\nscroll; in a content-sized parent it collapses to its content (no scroll,\nnot broken).\n",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"allOf": [
|
|
8
8
|
{
|
|
@@ -22,16 +22,19 @@
|
|
|
22
22
|
min-block-size: 0;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/* Pinned rails — <header
|
|
26
|
-
|
|
25
|
+
/* Pinned rails — native <header>/<footer>, OR any element that opts into the role
|
|
26
|
+
via slot="header"/"footer" (the drawer-ui pattern), so e.g. a <section slot="header">
|
|
27
|
+
becomes a pinned rail rather than the scroll body. Fixed height, never scroll. */
|
|
28
|
+
:scope > :is(header, footer, [slot="header"], [slot="footer"]) {
|
|
27
29
|
flex: 0 0 auto;
|
|
28
30
|
min-block-size: 0;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
/* The single scroll region
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
/* The single scroll region — native <section> OR slot="body", minus anything that
|
|
34
|
+
opted into a rail role above. `min-block-size: 0` lets the flex item shrink below
|
|
35
|
+
its content's intrinsic size — the flex-scroll gotcha that makes overflow:auto
|
|
36
|
+
actually scroll inside a column. */
|
|
37
|
+
:scope > :is(section, [slot="body"]):not([slot="header"]):not([slot="footer"]) {
|
|
35
38
|
flex: 1 1 auto;
|
|
36
39
|
min-block-size: 0;
|
|
37
40
|
overflow: auto;
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
chrome-less app-shell skeleton. A flex column that fills its parent's
|
|
4
4
|
block size: a native <header> child pins to the top, a <footer> child
|
|
5
5
|
pins to the bottom, and the <section> child scrolls between them (the
|
|
6
|
-
only region with overflow).
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
only region with overflow). Regions are positioned by tag + DOM order, OR any
|
|
7
|
+
element can take a region role via slot="header|body|footer" (a CSS [slot] match,
|
|
8
|
+
not native projection — ADR-0033) — e.g. <section slot="header"> as a pinned rail.
|
|
9
|
+
All three are OPTIONAL, so the common shape is just <section> + <footer>. Use for
|
|
10
|
+
tab / panel content
|
|
9
11
|
where actions stay visible while the body scrolls. Distinct from <card-ui>
|
|
10
12
|
(adds border + elevation + a rich header grid), <drawer-ui> / <modal-ui>
|
|
11
13
|
(add a backdrop + dismiss), and the page shells (<admin-page> / <page-ui>) —
|
|
@@ -11,9 +11,11 @@ description: |
|
|
|
11
11
|
chrome-less app-shell skeleton. A flex column that fills its parent's
|
|
12
12
|
block size: a native <header> child pins to the top, a <footer> child
|
|
13
13
|
pins to the bottom, and the <section> child scrolls between them (the
|
|
14
|
-
only region with overflow).
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
only region with overflow). Regions are positioned by tag + DOM order, OR any
|
|
15
|
+
element can take a region role via slot="header|body|footer" (a CSS [slot] match,
|
|
16
|
+
not native projection — ADR-0033) — e.g. <section slot="header"> as a pinned rail.
|
|
17
|
+
All three are OPTIONAL, so the common shape is just <section> + <footer>. Use for
|
|
18
|
+
tab / panel content
|
|
17
19
|
where actions stay visible while the body scrolls. Distinct from <card-ui>
|
|
18
20
|
(adds border + elevation + a rich header grid), <drawer-ui> / <modal-ui>
|
|
19
21
|
(add a backdrop + dismiss), and the page shells (<admin-page> / <page-ui>) —
|
|
@@ -33,8 +35,8 @@ a2ui:
|
|
|
33
35
|
rules:
|
|
34
36
|
- rule: 'Use <frame-ui> for a scroll-body-with-pinned-footer panel — the <section> scrolls; <header> / <footer> stay fixed.'
|
|
35
37
|
reason: 'The chrome-less app-shell frame.'
|
|
36
|
-
- rule: 'Regions are native <header> / <section> / <footer>
|
|
37
|
-
reason: 'Light
|
|
38
|
+
- rule: 'Regions are positioned by tag + DOM order (native <header> / <section> / <footer>) OR by a role slot: slot="header"/"footer" pins ANY element as a rail, slot="body" makes it the scroll region (e.g. <section slot="header"> is a pinned rail). The native tag is the 90% sugar; reach for the slot when the element you want differs from the region role.'
|
|
39
|
+
reason: 'CSS matches [slot=…] in Light DOM (ADR-0033, no native projection) — the same role-slot pattern as drawer-ui.'
|
|
38
40
|
- rule: 'Most panels need only <section> + <footer>; add <header> only when the panel has its own title or toolbar.'
|
|
39
41
|
reason: 'Header is optional.'
|
|
40
42
|
- rule: 'For a bordered/elevated surface use <card-ui>; for an overlay use <drawer-ui> / <modal-ui>; for routed page layout use <admin-page> / <page-ui>. frame-ui is the bare layout only.'
|
package/components/list/list.css
CHANGED
|
@@ -146,6 +146,10 @@
|
|
|
146
146
|
:scope [slot="text"] {
|
|
147
147
|
grid-column: 2;
|
|
148
148
|
grid-row: 1;
|
|
149
|
+
/* Center the title within row 1 so it aligns with the (also-centered) icon +
|
|
150
|
+
action. Without this, a full-height action button (e.g. onboarding's "Open")
|
|
151
|
+
makes row 1 taller than the title and the title top-aligns above the controls. */
|
|
152
|
+
align-self: center;
|
|
149
153
|
}
|
|
150
154
|
|
|
151
155
|
:scope [slot="description"] {
|
|
@@ -41,6 +41,15 @@ import { UIElement } from '../../core/element.js';
|
|
|
41
41
|
function dedent(src) {
|
|
42
42
|
let lines = src
|
|
43
43
|
.replace(/=""(?=[\s/>])/g, '') // boolean attr: truncate="" → truncate
|
|
44
|
+
// JSON / quote-bearing attribute values serialize as attr="…"…"…" —
|
|
45
|
+
// outerHTML escapes the inner " under the default double-quote delimiter. Re-render
|
|
46
|
+
// them single-quote-delimited (attr='…"…"…') — the clean, valid, copy-paste-able
|
|
47
|
+
// form the author actually wrote (e.g. items='[{"id":"a"}]'). Skipped when the value
|
|
48
|
+
// also contains a ' (no safe single-char delimiter — keep the escaped form).
|
|
49
|
+
.replace(/="([^"]*"[^"]*)"/g, (m, v) => {
|
|
50
|
+
const decoded = v.replace(/"/g, '"').replace(/&/g, '&');
|
|
51
|
+
return decoded.includes("'") ? m : `='${decoded}'`;
|
|
52
|
+
})
|
|
44
53
|
.replace(/\t/g, ' ')
|
|
45
54
|
.split('\n');
|
|
46
55
|
while (lines.length && lines[0].trim() === '') lines.shift();
|