@adia-ai/web-components 0.5.14 → 0.5.16

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.
@@ -36,7 +36,7 @@
36
36
  "default": false
37
37
  },
38
38
  "variant": {
39
- "description": "Typography variant — sets role tokens (size/weight/tracking/color).",
39
+ "description": "Typography variant — sets design-role tokens (size / weight /\ntracking / color / leading) per the L0 typography token family.\n**PRESENTATIONAL-ONLY (§247, FB-23 §2).** `<text-ui variant=\"heading\">`\ndoes NOT set `role=\"heading\"` + `aria-level` on the host. Document-\noutline assistive technology will treat the element as `role=\"generic\"`.\nFor semantic headings, wrap with native `<h1>`-`<h6>` OR add\n`role=\"heading\" aria-level=\"N\"` on the host directly. For visual-only\nlabels (eyebrows, kickers, captions, deck), the presentational default\nis correct. The §221k chooser guide in USAGE.md documents picker heuristics.",
40
40
  "type": "string",
41
41
  "enum": [
42
42
  "body",
@@ -52,7 +52,21 @@
52
52
  "metric",
53
53
  "code"
54
54
  ],
55
- "default": "body"
55
+ "default": "body",
56
+ "enum_descriptions": {
57
+ "title": "Page title (visual rank H1). Largest under display. Use at the top of an authoritative page or dialog.",
58
+ "body": "Default body copy. 14px / regular. Paragraphs, multi-line content, running prose.",
59
+ "caption": "Annotation under a primary line — smaller + muted. Use for image captions, footnotes.",
60
+ "code": "Inline monospace code reference. Use for inline code within prose.",
61
+ "deck": "Sub-title under a `title`. One-line lead, slightly larger than body. Use for the lead sentence after a title.",
62
+ "display": "Top-level hero / brand display. Tallest visual rank. Use for page-level hero one-liners.",
63
+ "heading": "Major page heading (visual rank H2). 16-18px / bold. Use for major sub-section dividers.",
64
+ "kicker": "Eyebrow text above a `title`. UPPERCASE + small + tracking. Use for content eyebrows (NOT form labels — use `label` for those).",
65
+ "label": "Form-control label (above an `<input-ui>` / `<select-ui>` etc). UI-sized + medium-weight. Use for field labels bound to form controls.",
66
+ "metric": "Numeric KPI / big-number stat. Bold + large. Use for dashboard metric numbers.",
67
+ "section": "Inline form-group / navlist heading (visual rank H4). Small-cap. Use for form group labels, nav list headings.",
68
+ "subsection": "Sub-landmark within a section (visual rank H3). 14px / semibold. Use for card titles within a section."
69
+ }
56
70
  }
57
71
  },
58
72
  "required": [
@@ -1,41 +1,28 @@
1
1
  /**
2
- * `<text-ui>` — Typography wrapper that applies role tokens. Supports
3
- * truncation and line clamping.
2
+ * `<text-ui>` — Typography wrapper that applies role tokens. Supports truncation and line clamping.
4
3
  *
5
4
  * @see https://ui-kit.exe.xyz/site/components/text
6
5
  *
7
- * HAND-AUTHORED (not codegen'd) per §247 (v0.5.10) — the yaml `enum:` schema
8
- * carries variant names but not per-value descriptions; codegen emits a
9
- * single property-level JSDoc and loses the per-variant disambiguation that
10
- * the §221k chooser guide documents. Hand-authored .d.ts carries per-variant
11
- * JSDoc inline so IDE hover surfaces the disambiguation at authoring time.
12
- * Also carries the FB-23 §2 ARIA-role disclaimer on the property doc.
13
- * `dts-codegen.mjs` keeps this file in its `HAND_AUTHORED_DTS` skip list.
6
+ * Type declarations generated by scripts/build/dts-codegen.mjs from
7
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
8
+ * run `npm run build:components`, then `npm run codegen:dts` to
9
+ * regenerate; or hand-author this file fully if rich event types are
10
+ * needed beyond what the yaml `events:` block can express.
14
11
  */
15
12
 
16
13
  import { UIElement } from '../../core/element.js';
17
14
 
18
- /**
19
- * Typography variants — visual rank from `display` (largest, hero) to
20
- * `code` (inline monospace). Pick by intent, not by visual size — every
21
- * variant has a distinct typographic role per §221k chooser guide.
22
- *
23
- * See `packages/web-components/USAGE.md` "v0.5.9 — Consumer-feedback
24
- * discoverability sweep" §221k for the picker heuristics.
25
- */
26
15
  export type UITextVariant =
27
16
  /** Default body copy. 14px / regular. Paragraphs, multi-line content, running prose. */
28
17
  | 'body'
29
- /** Top-level hero / brand display. Tallest visual rank. Use for page-level hero one-liners. */
30
- | 'display'
31
- /** Page title (visual rank H1). Largest under display. Use at the top of an authoritative page or dialog. */
32
- | 'title'
33
18
  /** Major page heading (visual rank H2). 16-18px / bold. Use for major sub-section dividers. */
34
19
  | 'heading'
20
+ /** Page title (visual rank H1). Largest under display. Use at the top of an authoritative page or dialog. */
21
+ | 'title'
35
22
  /** Sub-landmark within a section (visual rank H3). 14px / semibold. Use for card titles within a section. */
36
23
  | 'subsection'
37
- /** Inline form-group / navlist heading (visual rank H4). Small-cap. Use for form group labels, nav list headings. */
38
- | 'section'
24
+ /** Top-level hero / brand display. Tallest visual rank. Use for page-level hero one-liners. */
25
+ | 'display'
39
26
  /** Annotation under a primary line — smaller + muted. Use for image captions, footnotes. */
40
27
  | 'caption'
41
28
  /** Form-control label (above an `<input-ui>` / `<select-ui>` etc). UI-sized + medium-weight. Use for field labels bound to form controls. */
@@ -44,34 +31,30 @@ export type UITextVariant =
44
31
  | 'kicker'
45
32
  /** Sub-title under a `title`. One-line lead, slightly larger than body. Use for the lead sentence after a title. */
46
33
  | 'deck'
34
+ /** Inline form-group / navlist heading (visual rank H4). Small-cap. Use for form group labels, nav list headings. */
35
+ | 'section'
47
36
  /** Numeric KPI / big-number stat. Bold + large. Use for dashboard metric numbers. */
48
37
  | 'metric'
49
- /** Inline monospace code reference. Use for `\`code\`` inline within prose. */
38
+ /** Inline monospace code reference. Use for inline code within prose. */
50
39
  | 'code';
51
40
 
52
41
  export class UIText extends UIElement {
53
- /**
54
- * Typography variant — sets design-role tokens (size / weight / tracking /
55
- * color / leading) per the L0 typography token family.
56
- *
57
- * **PRESENTATIONAL-ONLY (§247, FB-23 §2).** `<text-ui variant="heading">`
58
- * does NOT set `role="heading"` + `aria-level` on the host. Document-outline
59
- * assistive technology will treat the element as `role="generic"`. For
60
- * **semantic** headings (screen-reader heading-navigation, document
61
- * outline), wrap with native `<h1>`-`<h6>` OR add
62
- * `role="heading" aria-level="N"` on the host element directly.
63
- *
64
- * For visual-only labels (eyebrows, kickers, captions, deck), the
65
- * presentational default is correct. The §221k chooser guide in USAGE.md
66
- * documents the picker heuristics.
67
- */
68
- variant: UITextVariant;
69
- /** When true, applies stronger emphasis (heavier weight + accent color). Styled via `:scope[strong]` in text.css. Use instead of `variant="heading"` when you want a single emphasized word inline in body copy. */
70
- strong: boolean;
71
- /** Single-line truncation with ellipsis. Ignored when `lines` is set. */
72
- truncate: boolean;
73
- /** Multi-line clamp count (0 = no clamp). Sets `--_text-lines` for `-webkit-line-clamp`. */
42
+ /** Multi-line clamp count (0 = no clamp) */
74
43
  lines: number;
44
+ /** When true, applies stronger emphasis (heavier weight + accent color). Styled via :scope[strong] in text.css. Use instead of variant=heading when you want a single emphasized word inline in body copy. */
45
+ strong: boolean;
75
46
  /** Display text content. The main payload field for Text components extracted from HTML. */
76
47
  textContent: string;
48
+ /** Single-line truncation with ellipsis. Ignored when `lines` is set. */
49
+ truncate: boolean;
50
+ /** Typography variant — sets design-role tokens (size / weight /
51
+ tracking / color / leading) per the L0 typography token family.
52
+ **PRESENTATIONAL-ONLY (§247, FB-23 §2).** `<text-ui variant="heading">`
53
+ does NOT set `role="heading"` + `aria-level` on the host. Document-
54
+ outline assistive technology will treat the element as `role="generic"`.
55
+ For semantic headings, wrap with native `<h1>`-`<h6>` OR add
56
+ `role="heading" aria-level="N"` on the host directly. For visual-only
57
+ labels (eyebrows, kickers, captions, deck), the presentational default
58
+ is correct. The §221k chooser guide in USAGE.md documents picker heuristics. */
59
+ variant: UITextVariant;
77
60
  }
@@ -28,7 +28,16 @@ props:
28
28
  default: ""
29
29
  dynamic: true
30
30
  variant:
31
- description: Typography variant — sets role tokens (size/weight/tracking/color).
31
+ description: |-
32
+ Typography variant — sets design-role tokens (size / weight /
33
+ tracking / color / leading) per the L0 typography token family.
34
+ **PRESENTATIONAL-ONLY (§247, FB-23 §2).** `<text-ui variant="heading">`
35
+ does NOT set `role="heading"` + `aria-level` on the host. Document-
36
+ outline assistive technology will treat the element as `role="generic"`.
37
+ For semantic headings, wrap with native `<h1>`-`<h6>` OR add
38
+ `role="heading" aria-level="N"` on the host directly. For visual-only
39
+ labels (eyebrows, kickers, captions, deck), the presentational default
40
+ is correct. The §221k chooser guide in USAGE.md documents picker heuristics.
32
41
  type: string
33
42
  default: body
34
43
  enum:
@@ -44,6 +53,21 @@ props:
44
53
  - section
45
54
  - metric
46
55
  - code
56
+ # §324 (v0.5.15, FB-23 §3 retire): per-variant JSDoc surfaces at IDE
57
+ # hover via codegen. Retires the HAND_AUTHORED_DTS skip for text.d.ts.
58
+ enum_descriptions:
59
+ body: Default body copy. 14px / regular. Paragraphs, multi-line content, running prose.
60
+ display: Top-level hero / brand display. Tallest visual rank. Use for page-level hero one-liners.
61
+ title: Page title (visual rank H1). Largest under display. Use at the top of an authoritative page or dialog.
62
+ heading: Major page heading (visual rank H2). 16-18px / bold. Use for major sub-section dividers.
63
+ subsection: Sub-landmark within a section (visual rank H3). 14px / semibold. Use for card titles within a section.
64
+ section: Inline form-group / navlist heading (visual rank H4). Small-cap. Use for form group labels, nav list headings.
65
+ caption: Annotation under a primary line — smaller + muted. Use for image captions, footnotes.
66
+ label: Form-control label (above an `<input-ui>` / `<select-ui>` etc). UI-sized + medium-weight. Use for field labels bound to form controls.
67
+ kicker: Eyebrow text above a `title`. UPPERCASE + small + tracking. Use for content eyebrows (NOT form labels — use `label` for those).
68
+ deck: Sub-title under a `title`. One-line lead, slightly larger than body. Use for the lead sentence after a title.
69
+ metric: Numeric KPI / big-number stat. Bold + large. Use for dashboard metric numbers.
70
+ code: Inline monospace code reference. Use for inline code within prose.
47
71
  events: {}
48
72
  slots: {}
49
73
  states:
@@ -104,7 +104,7 @@ toolbar-ui [data-toolbar-spillover-menu]:popover-open {
104
104
  min-width: 10rem;
105
105
  font-family: inherit;
106
106
  font-size: var(--a-ui-size);
107
- color: var(--a-fg);
107
+ color: var(--toolbar-fg);
108
108
  /* Stack overflow items as rows (each row can be a group with its own gap). */
109
109
  display: flex;
110
110
  flex-direction: column;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "description": "AdiaUI web components — 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",
@@ -116,20 +116,21 @@
116
116
  --a-fg-muted: var(--a-canvas-text-muted);
117
117
  --a-fg-strong: var(--a-canvas-text-strong);
118
118
  --a-fg-hover: var(--a-canvas-text-strong);
119
- --a-fg-active: var(--a-canvas-text-strong);
119
+ /* ADR-0028: --a-fg-{active,invalid} retired (zero consumers). Use
120
+ `--a-ui-text-active` / `--a-ui-text-invalid` for form-control state,
121
+ or define a per-primitive `--<comp>-fg-{active,invalid}` token. */
120
122
  --a-fg-selected: var(--a-canvas-text-strong);
121
123
  --a-fg-disabled: var(--a-canvas-text-disabled);
122
- --a-fg-invalid: var(--a-danger-text);
123
124
  --a-fg-inverse: var(--a-canvas-text-inverse);
124
125
 
125
126
  --a-border: var(--a-canvas-border);
126
127
  --a-border-subtle: var(--a-canvas-border-subtle);
127
128
  --a-border-strong: var(--a-canvas-border-strong);
128
129
  --a-border-hover: var(--a-canvas-border-strong);
129
- --a-border-active: var(--a-accent-border);
130
- --a-border-selected: var(--a-accent-border);
131
- --a-border-disabled: var(--a-canvas-border-subtle);
132
- --a-border-invalid: var(--a-danger-border);
130
+ /* ADR-0028: --a-border-{active,selected,disabled,invalid} retired (zero
131
+ consumers). Per-primitive `--<comp>-border-{state}` is the override
132
+ surface; `--a-focus-ring` carries focus-active borders for form
133
+ controls. */
133
134
 
134
135
  /* ══════════════════════════════════════════════════════════════
135
136
  ACCENT — Interactive, links, focus (source for --a-primary-*)
@@ -172,23 +173,12 @@
172
173
  --a-primary-bg: var(--a-accent-strong);
173
174
  --a-primary-bg-hover: var(--a-accent-hover);
174
175
  --a-primary-bg-active: var(--a-accent-active);
175
- --a-primary-bg-selected: var(--a-accent-selected);
176
- --a-primary-bg-disabled: var(--a-accent-muted);
177
- --a-primary-bg-invalid: var(--a-danger-muted);
178
176
 
179
177
  --a-primary-fg: var(--a-accent-05-tint);
180
178
  --a-primary-fg-hover: var(--a-accent-text-strong);
181
- --a-primary-fg-active: var(--a-accent-text-strong);
182
- --a-primary-fg-selected: var(--a-accent-text-strong);
183
- --a-primary-fg-disabled: var(--a-accent-text-disabled);
184
- --a-primary-fg-invalid: var(--a-danger-text);
185
179
 
186
180
  --a-primary-border: var(--a-accent-border);
187
181
  --a-primary-border-hover: var(--a-accent-border-strong);
188
- --a-primary-border-active: var(--a-accent-border-strong);
189
- --a-primary-border-selected: var(--a-accent-border-strong);
190
- --a-primary-border-disabled: var(--a-accent-border-subtle);
191
- --a-primary-border-invalid: var(--a-danger-border);
192
182
 
193
183
  /* Legacy shorthand — keep until all components migrate to --a-primary-* */
194
184
  --a-primary: var(--a-primary-bg);
@@ -200,16 +190,9 @@
200
190
  --a-accent-bg: var(--a-primary-bg);
201
191
  --a-accent-bg-hover: var(--a-primary-bg-hover);
202
192
  --a-accent-bg-active: var(--a-primary-bg-active);
203
- --a-accent-bg-selected: var(--a-primary-bg-selected);
204
- --a-accent-bg-disabled: var(--a-primary-bg-disabled);
205
- --a-accent-bg-invalid: var(--a-primary-bg-invalid);
206
193
 
207
194
  --a-accent-fg: var(--a-primary-fg);
208
195
  --a-accent-fg-hover: var(--a-primary-fg-hover);
209
- --a-accent-fg-active: var(--a-primary-fg-active);
210
- --a-accent-fg-selected: var(--a-primary-fg-selected);
211
- --a-accent-fg-disabled: var(--a-primary-fg-disabled);
212
- --a-accent-fg-invalid: var(--a-primary-fg-invalid);
213
196
 
214
197
  /* accent border is already defined at L2 (--a-accent-border*);
215
198
  L3 matches L2 since both resolve to the same scheme-aware value. */
@@ -239,24 +222,12 @@
239
222
  /* L3 — Brand surface role matrix */
240
223
  --a-brand-bg: var(--a-brand-strong);
241
224
  --a-brand-bg-hover: var(--a-brand-hover);
242
- --a-brand-bg-active: var(--a-brand-active);
243
- --a-brand-bg-selected: var(--a-brand-selected);
244
- --a-brand-bg-disabled: var(--a-brand-muted);
245
- --a-brand-bg-invalid: var(--a-danger-muted);
246
225
 
247
226
  --a-brand-fg: var(--a-brand-text-strong);
248
227
  --a-brand-fg-hover: var(--a-brand-text-strong);
249
- --a-brand-fg-active: var(--a-brand-text-strong);
250
- --a-brand-fg-selected: var(--a-brand-text-strong);
251
- --a-brand-fg-disabled: var(--a-brand-text-disabled);
252
- --a-brand-fg-invalid: var(--a-danger-text);
253
228
 
254
229
  /* L3 border state matrix — rest state is --a-brand-border (L2 above). */
255
230
  --a-brand-border-hover: var(--a-brand-border-strong);
256
- --a-brand-border-active: var(--a-brand-border-strong);
257
- --a-brand-border-selected: var(--a-brand-border-strong);
258
- --a-brand-border-disabled: var(--a-brand-border-subtle);
259
- --a-brand-border-invalid: var(--a-danger-border);
260
231
 
261
232
  /* ══════════════════════════════════════════════════════════════
262
233
  INFO
@@ -283,24 +254,12 @@
283
254
  /* L3 — Info surface role matrix */
284
255
  --a-info-bg: var(--a-info-strong);
285
256
  --a-info-bg-hover: var(--a-info-hover);
286
- --a-info-bg-active: var(--a-info-active);
287
- --a-info-bg-selected: var(--a-info-selected);
288
- --a-info-bg-disabled: var(--a-info-muted);
289
- --a-info-bg-invalid: var(--a-danger-muted);
290
257
 
291
258
  --a-info-fg: var(--a-info-text-strong);
292
259
  --a-info-fg-hover: var(--a-info-text-strong);
293
- --a-info-fg-active: var(--a-info-text-strong);
294
- --a-info-fg-selected: var(--a-info-text-strong);
295
- --a-info-fg-disabled: var(--a-info-text-disabled);
296
- --a-info-fg-invalid: var(--a-danger-text);
297
260
 
298
261
  /* L3 border state matrix — rest state is --a-info-border (L2 above). */
299
262
  --a-info-border-hover: var(--a-info-border-strong);
300
- --a-info-border-active: var(--a-info-border-strong);
301
- --a-info-border-selected: var(--a-info-border-strong);
302
- --a-info-border-disabled: var(--a-info-border-subtle);
303
- --a-info-border-invalid: var(--a-danger-border);
304
263
 
305
264
  /* ══════════════════════════════════════════════════════════════
306
265
  SUCCESS
@@ -327,24 +286,12 @@
327
286
  /* L3 — Success surface role matrix */
328
287
  --a-success-bg: var(--a-success-strong);
329
288
  --a-success-bg-hover: var(--a-success-hover);
330
- --a-success-bg-active: var(--a-success-active);
331
- --a-success-bg-selected: var(--a-success-selected);
332
- --a-success-bg-disabled: var(--a-success-muted);
333
- --a-success-bg-invalid: var(--a-danger-muted);
334
289
 
335
290
  --a-success-fg: var(--a-success-text-strong);
336
291
  --a-success-fg-hover: var(--a-success-text-strong);
337
- --a-success-fg-active: var(--a-success-text-strong);
338
- --a-success-fg-selected: var(--a-success-text-strong);
339
- --a-success-fg-disabled: var(--a-success-text-disabled);
340
- --a-success-fg-invalid: var(--a-danger-text);
341
292
 
342
293
  /* L3 border state matrix — rest state is --a-success-border (L2 above). */
343
294
  --a-success-border-hover: var(--a-success-border-strong);
344
- --a-success-border-active: var(--a-success-border-strong);
345
- --a-success-border-selected: var(--a-success-border-strong);
346
- --a-success-border-disabled: var(--a-success-border-subtle);
347
- --a-success-border-invalid: var(--a-danger-border);
348
295
 
349
296
  /* ══════════════════════════════════════════════════════════════
350
297
  WARNING
@@ -372,24 +319,12 @@
372
319
  /* L3 — Warning surface role matrix */
373
320
  --a-warning-bg: var(--a-warning-strong);
374
321
  --a-warning-bg-hover: var(--a-warning-hover);
375
- --a-warning-bg-active: var(--a-warning-active);
376
- --a-warning-bg-selected: var(--a-warning-selected);
377
- --a-warning-bg-disabled: var(--a-warning-muted);
378
- --a-warning-bg-invalid: var(--a-danger-muted);
379
322
 
380
323
  --a-warning-fg: var(--a-warning-text-strong);
381
324
  --a-warning-fg-hover: var(--a-warning-text-strong);
382
- --a-warning-fg-active: var(--a-warning-text-strong);
383
- --a-warning-fg-selected: var(--a-warning-text-strong);
384
- --a-warning-fg-disabled: var(--a-warning-text-disabled);
385
- --a-warning-fg-invalid: var(--a-danger-text);
386
325
 
387
326
  /* L3 border state matrix — rest state is --a-warning-border (L2 above). */
388
327
  --a-warning-border-hover: var(--a-warning-border-strong);
389
- --a-warning-border-active: var(--a-warning-border-strong);
390
- --a-warning-border-selected: var(--a-warning-border-strong);
391
- --a-warning-border-disabled: var(--a-warning-border-subtle);
392
- --a-warning-border-invalid: var(--a-danger-border);
393
328
 
394
329
  /* ══════════════════════════════════════════════════════════════
395
330
  DANGER
@@ -418,24 +353,12 @@
418
353
  /* L3 — Danger surface role matrix */
419
354
  --a-danger-bg: var(--a-danger-strong);
420
355
  --a-danger-bg-hover: var(--a-danger-hover);
421
- --a-danger-bg-active: var(--a-danger-active);
422
- --a-danger-bg-selected: var(--a-danger-selected);
423
- --a-danger-bg-disabled: var(--a-danger-muted);
424
- --a-danger-bg-invalid: var(--a-danger-muted);
425
356
 
426
357
  --a-danger-fg: var(--a-danger-text-strong);
427
358
  --a-danger-fg-hover: var(--a-danger-text-strong);
428
- --a-danger-fg-active: var(--a-danger-text-strong);
429
- --a-danger-fg-selected: var(--a-danger-text-strong);
430
- --a-danger-fg-disabled: var(--a-danger-text-disabled);
431
- --a-danger-fg-invalid: var(--a-danger-text);
432
359
 
433
360
  /* L3 border state matrix — rest state is --a-danger-border (L2 above). */
434
361
  --a-danger-border-hover: var(--a-danger-border-strong);
435
- --a-danger-border-active: var(--a-danger-border-strong);
436
- --a-danger-border-selected: var(--a-danger-border-strong);
437
- --a-danger-border-disabled: var(--a-danger-border-subtle);
438
- --a-danger-border-invalid: var(--a-danger-border);
439
362
 
440
363
  /* ══════════════════════════════════════════════════════════════
441
364
  BUCKETS — sequential 5-step ramp per family for data-vis consumers