@adia-ai/web-components 0.7.1 → 0.7.3
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 +32 -0
- package/components/card/card.css +1 -1
- package/components/col/col.a2ui.json +1 -1
- package/components/col/col.css +1 -1
- package/components/col/col.d.ts +1 -1
- package/components/col/col.yaml +6 -3
- package/components/grid/grid.a2ui.json +1 -1
- package/components/grid/grid.css +4 -3
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/grid.yaml +5 -3
- package/components/menu/menu.class.js +14 -2
- package/components/row/row.a2ui.json +1 -1
- package/components/row/row.css +6 -4
- package/components/row/row.d.ts +1 -1
- package/components/row/row.yaml +4 -2
- package/components/stat/stat.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/tree/tree.class.js +89 -16
- package/components/tree/tree.test.js +49 -0
- package/core/template.js +9 -0
- package/core/template.test.js +36 -0
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +3 -3
- package/package.json +1 -1
- package/styles/api/sizing.css +52 -16
- package/styles/foundation/space.css +20 -4
- package/styles/prose.css +7 -4
- package/styles/type/roles.css +5 -0
- package/styles/typography.css +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
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",
|
package/styles/api/sizing.css
CHANGED
|
@@ -117,54 +117,90 @@
|
|
|
117
117
|
--a-code-size: var(--a-code-lg);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
121
|
+
[gap] — the EXPLICIT per-element gap (a spatial Scale attr).
|
|
122
|
+
|
|
123
|
+
Sets --a-gap-self, a NON-inheriting token, so an explicit gap on a
|
|
124
|
+
parent does NOT leak into nested layout primitives. This is the
|
|
125
|
+
counterpart to --a-gap, the AMBIENT gap set by [size]/[prose]/:root
|
|
126
|
+
(which DOES inherit — `<div size="sm">` shifts the whole subtree).
|
|
127
|
+
Gap-reading components resolve `var(--a-gap-self, var(--a-gap))`:
|
|
128
|
+
explicit-if-present, else fall through to the inherited ambient.
|
|
129
|
+
Design: docs/specs/attribute-api-system.md §5.2 (ADR-0038 / D2).
|
|
130
|
+
|
|
131
|
+
syntax:"*" (NOT "<length>") is load-bearing: a universal-syntax
|
|
132
|
+
@property may omit initial-value, leaving the token genuinely
|
|
133
|
+
*unset-able* (guaranteed-invalid when not set) — so the fallback to
|
|
134
|
+
--a-gap fires for elements without [gap]. A typed @property carries a
|
|
135
|
+
mandatory initial-value that always-resolves and would mask the
|
|
136
|
+
ambient. inherits:false stops the leak (audit C3).
|
|
137
|
+
═══════════════════════════════════════════════════════════════ */
|
|
138
|
+
@property --a-gap-self {
|
|
139
|
+
syntax: "*";
|
|
140
|
+
inherits: false;
|
|
141
|
+
}
|
|
142
|
+
|
|
120
143
|
[gap="0"] {
|
|
121
|
-
--a-gap: 0;
|
|
144
|
+
--a-gap-self: 0;
|
|
122
145
|
}
|
|
123
146
|
[gap="1"] {
|
|
124
|
-
--a-gap: var(--a-space-1);
|
|
147
|
+
--a-gap-self: var(--a-space-1);
|
|
125
148
|
}
|
|
126
149
|
[gap="2"] {
|
|
127
|
-
--a-gap: var(--a-space-2);
|
|
150
|
+
--a-gap-self: var(--a-space-2);
|
|
128
151
|
}
|
|
129
152
|
[gap="3"] {
|
|
130
|
-
--a-gap: var(--a-space-3);
|
|
153
|
+
--a-gap-self: var(--a-space-3);
|
|
131
154
|
}
|
|
132
155
|
[gap="4"] {
|
|
133
|
-
--a-gap: var(--a-space-4);
|
|
156
|
+
--a-gap-self: var(--a-space-4);
|
|
134
157
|
}
|
|
135
158
|
[gap="5"] {
|
|
136
|
-
--a-gap: var(--a-space-5);
|
|
159
|
+
--a-gap-self: var(--a-space-5);
|
|
137
160
|
}
|
|
138
161
|
[gap="6"] {
|
|
139
|
-
--a-gap: var(--a-space-6);
|
|
162
|
+
--a-gap-self: var(--a-space-6);
|
|
140
163
|
}
|
|
141
164
|
[gap="7"] {
|
|
142
|
-
--a-gap: var(--a-space-7);
|
|
165
|
+
--a-gap-self: var(--a-space-7);
|
|
143
166
|
}
|
|
144
167
|
[gap="8"] {
|
|
145
|
-
--a-gap: var(--a-space-8);
|
|
168
|
+
--a-gap-self: var(--a-space-8);
|
|
146
169
|
}
|
|
147
170
|
[gap="9"] {
|
|
148
|
-
--a-gap: var(--a-space-9);
|
|
171
|
+
--a-gap-self: var(--a-space-9);
|
|
149
172
|
}
|
|
150
173
|
[gap="10"] {
|
|
151
|
-
--a-gap: var(--a-space-10);
|
|
174
|
+
--a-gap-self: var(--a-space-10);
|
|
152
175
|
}
|
|
153
176
|
[gap="12"] {
|
|
154
|
-
--a-gap: var(--a-space-12);
|
|
177
|
+
--a-gap-self: var(--a-space-12);
|
|
155
178
|
}
|
|
156
179
|
[gap="16"] {
|
|
157
|
-
--a-gap: var(--a-space-16);
|
|
180
|
+
--a-gap-self: var(--a-space-16);
|
|
158
181
|
}
|
|
159
182
|
|
|
183
|
+
/* Named scale — the semantic, parametric gap vocabulary (xs/sm/md/lg/xl).
|
|
184
|
+
References the --a-gap-* tokens (foundation/space.css) so explicit
|
|
185
|
+
[gap="md"] AGREES with the ambient ([size]) and responsive (JS _gapToCss)
|
|
186
|
+
paths — all resolve to --a-gap-md — and tracks the --a-gap-k knob. This is
|
|
187
|
+
distinct from the integer rules above, which are LITERAL space-rungs
|
|
188
|
+
(k-independent). At k=1 the two grammars coincide: xs=1, sm=2, md=3,
|
|
189
|
+
lg=4, xl=5. (C1/C2 resolution — two coherent grammars, not one deprecated.) */
|
|
190
|
+
[gap="xs"] {
|
|
191
|
+
--a-gap-self: var(--a-gap-xs);
|
|
192
|
+
}
|
|
160
193
|
[gap="sm"] {
|
|
161
|
-
--a-gap: var(--a-
|
|
194
|
+
--a-gap-self: var(--a-gap-sm);
|
|
162
195
|
}
|
|
163
196
|
[gap="md"] {
|
|
164
|
-
--a-gap: var(--a-
|
|
197
|
+
--a-gap-self: var(--a-gap-md);
|
|
165
198
|
}
|
|
166
199
|
[gap="lg"] {
|
|
167
|
-
--a-gap: var(--a-
|
|
200
|
+
--a-gap-self: var(--a-gap-lg);
|
|
201
|
+
}
|
|
202
|
+
[gap="xl"] {
|
|
203
|
+
--a-gap-self: var(--a-gap-xl);
|
|
168
204
|
}
|
|
169
205
|
|
|
170
206
|
/* ── Universal [padding] / [margin] — same scale as [gap]. Layout
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
initial-value: 1;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/* Gap-scale knob — scales the k-driven half of every named gap
|
|
15
|
+
(--a-gap-{xs,sm,md,lg,xl}). k=1 (default) = baseline scale; <1 tightens
|
|
16
|
+
toward the floor, >1 loosens. Inherits, so set it at a provider boundary
|
|
17
|
+
(e.g. style="--a-gap-k:1.5") to retune all named gaps in a subtree. */
|
|
18
|
+
@property --a-gap-k {
|
|
19
|
+
syntax: "<number>";
|
|
20
|
+
inherits: true;
|
|
21
|
+
initial-value: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
:root {
|
|
15
25
|
/* ── Spacing ── */
|
|
16
26
|
--a-space-0: 0;
|
|
@@ -39,9 +49,15 @@
|
|
|
39
49
|
--a-inset-lg: var(--a-space-6);
|
|
40
50
|
--a-inset: var(--a-inset-md);
|
|
41
51
|
|
|
42
|
-
/* ── Gaps
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
/* ── Gaps — parametric named scale (half + half·k). Each token is a
|
|
53
|
+
fixed floor (half its k=1 value) plus a k-scaled half, so --a-gap-k
|
|
54
|
+
loosens/tightens the whole named scale while never collapsing below the
|
|
55
|
+
floor. At k=1: 4 / 8 / 12 / 16 / 20px. Composes on top of --a-density
|
|
56
|
+
(baked into --a-space-*). See styles/api/sizing.css + spec §5.2. ── */
|
|
57
|
+
--a-gap-xs: calc(var(--a-space-0-5) + var(--a-space-0-5) * var(--a-gap-k)); /* 4px @k=1 */
|
|
58
|
+
--a-gap-sm: calc(var(--a-space-1) + var(--a-space-1) * var(--a-gap-k)); /* 8px @k=1 */
|
|
59
|
+
--a-gap-md: calc(var(--a-space-1-5) + var(--a-space-1-5) * var(--a-gap-k)); /* 12px @k=1 */
|
|
60
|
+
--a-gap-lg: calc(var(--a-space-2) + var(--a-space-2) * var(--a-gap-k)); /* 16px @k=1 */
|
|
61
|
+
--a-gap-xl: calc(var(--a-space-2-5) + var(--a-space-2-5) * var(--a-gap-k)); /* 20px @k=1 */
|
|
46
62
|
--a-gap: var(--a-gap-md);
|
|
47
63
|
}
|
package/styles/prose.css
CHANGED
|
@@ -29,10 +29,13 @@
|
|
|
29
29
|
--a-inset-lg: var(--a-space-10);
|
|
30
30
|
--a-inset: var(--a-inset-md);
|
|
31
31
|
|
|
32
|
-
/* ── Gaps —
|
|
33
|
-
|
|
34
|
-
--a-gap-
|
|
35
|
-
--a-gap-
|
|
32
|
+
/* ── Gaps — prose register, one rung up; same parametric (half + half·k)
|
|
33
|
+
form as foundation, tracking --a-gap-k. At k=1: 8/12/16/20/24px. ── */
|
|
34
|
+
--a-gap-xs: calc(var(--a-space-1) + var(--a-space-1) * var(--a-gap-k)); /* 8px @k=1 */
|
|
35
|
+
--a-gap-sm: calc(var(--a-space-1-5) + var(--a-space-1-5) * var(--a-gap-k)); /* 12px @k=1 */
|
|
36
|
+
--a-gap-md: calc(var(--a-space-2) + var(--a-space-2) * var(--a-gap-k)); /* 16px @k=1 */
|
|
37
|
+
--a-gap-lg: calc(var(--a-space-2-5) + var(--a-space-2-5) * var(--a-gap-k)); /* 20px @k=1 */
|
|
38
|
+
--a-gap-xl: calc(var(--a-space-3) + var(--a-space-3) * var(--a-gap-k)); /* 24px @k=1 */
|
|
36
39
|
--a-gap: var(--a-gap-md);
|
|
37
40
|
|
|
38
41
|
/* ── Sizing — larger controls ── */
|
package/styles/type/roles.css
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
type/elements.css) — safe because [variant] is (0,1,0) and native
|
|
7
7
|
element defaults are :where() (0,0,0); specificity decides, not order. */
|
|
8
8
|
|
|
9
|
+
/* Role tokens → `tokens` layer — completes the tokens layer the @layer migration
|
|
10
|
+
deferred (ADR-0038). Behavior-neutral: each token is declared once, so layer
|
|
11
|
+
assignment can't change resolution. */
|
|
12
|
+
@layer tokens {
|
|
9
13
|
:root {
|
|
10
14
|
/* ═══════════════════════════════════════════════════════════
|
|
11
15
|
L3 ROLES — 13 roles across 6 jobs
|
|
@@ -246,6 +250,7 @@
|
|
|
246
250
|
+ expressive hero + standard body.
|
|
247
251
|
═══════════════════════════════════════════════════════════ */
|
|
248
252
|
}
|
|
253
|
+
} /* @layer tokens — role tokens */
|
|
249
254
|
|
|
250
255
|
/* ═══════════════════════════════════════════════════════════
|
|
251
256
|
VARIANT ATTRIBUTE — applies typography roles to any element.
|
package/styles/typography.css
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
api/{text,layout}.css (v0.6.48 foundation reorg, ADR-0035). The imports
|
|
59
59
|
below reproduce the historical cascade order exactly. */
|
|
60
60
|
|
|
61
|
-
@import "./type/scale.css"; /* L1/L2 — families, weights, leading, tracking */
|
|
61
|
+
@import "./type/scale.css" layer(tokens); /* L1/L2 — families, weights, leading, tracking → tokens layer (ADR-0038) */
|
|
62
62
|
@import "./type/roles.css"; /* L3 — 13 roles + h1-h6 + [variant] */
|
|
63
63
|
@import "./type/elements.css" layer(elements); /* native element defaults → elements layer (ADR-0038 step 4) */
|
|
64
64
|
@import "./api/text.css" layer(utilities); /* [text-align][weight][color][transform][truncate] → utilities (ADR-0038 step 6) */
|