@adia-ai/web-components 0.8.31 → 0.8.33

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 (164) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/MIGRATION.md +136 -0
  3. package/components/accordion/accordion-item.a2ui.json +8 -0
  4. package/components/accordion/accordion-item.yaml +6 -0
  5. package/components/accordion/accordion.css +3 -1
  6. package/components/accordion/accordion.d.ts +2 -2
  7. package/components/action-list/action-list.class.js +6 -2
  8. package/components/action-list/action-list.d.ts +1 -1
  9. package/components/agent-artifact/agent-artifact.d.ts +1 -1
  10. package/components/agent-feedback-bar/agent-feedback-bar.d.ts +2 -2
  11. package/components/agent-questions/agent-questions.d.ts +1 -1
  12. package/components/agent-reasoning/agent-reasoning.d.ts +3 -3
  13. package/components/agent-suggestions/agent-suggestions.d.ts +1 -1
  14. package/components/agent-trace/agent-trace.d.ts +1 -1
  15. package/components/alert/alert.a2ui.json +3 -5
  16. package/components/alert/alert.class.js +3 -3
  17. package/components/alert/alert.css +5 -12
  18. package/components/alert/alert.d.ts +4 -4
  19. package/components/alert/alert.yaml +6 -5
  20. package/components/anchor-bar/anchor-bar.d.ts +2 -2
  21. package/components/avatar/avatar.class.js +0 -1
  22. package/components/avatar/avatar.css +16 -2
  23. package/components/badge/badge.a2ui.json +6 -9
  24. package/components/badge/badge.class.js +4 -4
  25. package/components/badge/badge.css +134 -74
  26. package/components/badge/badge.d.ts +34 -12
  27. package/components/badge/badge.examples.md +1 -1
  28. package/components/badge/badge.yaml +37 -16
  29. package/components/breadcrumb/breadcrumb.css +15 -3
  30. package/components/button/button.a2ui.json +1 -1
  31. package/components/button/button.css +4 -2
  32. package/components/button/button.d.ts +3 -3
  33. package/components/button/button.yaml +1 -1
  34. package/components/calendar-grid/calendar-grid.d.ts +2 -2
  35. package/components/card/card.css +21 -0
  36. package/components/card/card.yaml +10 -1
  37. package/components/chart/chart.class.js +8 -4
  38. package/components/chart/chart.d.ts +4 -4
  39. package/components/chart-legend/chart-legend.d.ts +1 -1
  40. package/components/chat-thread/chat-input.css +1 -1
  41. package/components/chat-thread/chat-thread.d.ts +2 -2
  42. package/components/check/check.css +3 -3
  43. package/components/command/command.d.ts +2 -2
  44. package/components/context-menu/context-menu.d.ts +3 -3
  45. package/components/datetime-picker/datetime-picker.d.ts +5 -5
  46. package/components/demo-toggle/demo-toggle.d.ts +1 -1
  47. package/components/drawer/drawer.d.ts +2 -2
  48. package/components/heatmap/heatmap.d.ts +5 -5
  49. package/components/index.js +1 -0
  50. package/components/inline-edit/inline-edit.d.ts +4 -4
  51. package/components/input/input.a2ui.json +4 -1
  52. package/components/input/input.css +18 -0
  53. package/components/input/input.yaml +11 -1
  54. package/components/integration-card/integration-card.class.js +11 -2
  55. package/components/integration-card/integration-card.d.ts +4 -4
  56. package/components/link/link.d.ts +1 -1
  57. package/components/list/list.class.js +22 -7
  58. package/components/list/list.d.ts +1 -1
  59. package/components/list-window/list-window.d.ts +5 -5
  60. package/components/mark/mark.a2ui.json +6 -7
  61. package/components/mark/mark.class.js +1 -1
  62. package/components/mark/mark.css +7 -4
  63. package/components/mark/mark.d.ts +2 -2
  64. package/components/mark/mark.examples.md +0 -4
  65. package/components/mark/mark.yaml +16 -6
  66. package/components/menu/menu.css +2 -2
  67. package/components/menu/menu.d.ts +1 -1
  68. package/components/modal/modal.d.ts +1 -1
  69. package/components/nav/nav.css +8 -0
  70. package/components/nav/nav.d.ts +1 -1
  71. package/components/nav-group/nav-group.css +58 -9
  72. package/components/nav-group/nav-group.d.ts +1 -1
  73. package/components/nav-item/nav-item.css +7 -4
  74. package/components/nav-item/nav-item.d.ts +1 -1
  75. package/components/noodles/noodles.d.ts +3 -3
  76. package/components/option-card/option-card.css +1 -1
  77. package/components/option-card/option-card.examples.md +1 -1
  78. package/components/pagination/pagination.d.ts +1 -1
  79. package/components/pane/pane.d.ts +1 -1
  80. package/components/password-strength/password-strength.d.ts +1 -1
  81. package/components/popover/popover.a2ui.json +5 -0
  82. package/components/popover/popover.class.js +9 -4
  83. package/components/popover/popover.css +5 -2
  84. package/components/popover/popover.yaml +8 -0
  85. package/components/preview/preview.examples.md +1 -1
  86. package/components/radio/radio.a2ui.json +4 -3
  87. package/components/radio/radio.css +2 -2
  88. package/components/radio/radio.yaml +7 -14
  89. package/components/radio-group/radio-group.a2ui.json +118 -0
  90. package/components/radio-group/radio-group.class.js +75 -0
  91. package/components/radio-group/radio-group.css +31 -0
  92. package/components/radio-group/radio-group.d.ts +20 -0
  93. package/components/radio-group/radio-group.examples.md +37 -0
  94. package/components/radio-group/radio-group.js +17 -0
  95. package/components/radio-group/radio-group.yaml +114 -0
  96. package/components/stat/stat.css +12 -8
  97. package/components/stat/stat.js +66 -1
  98. package/components/stat/stat.yaml +3 -0
  99. package/components/stepper/stepper-item.a2ui.json +5 -0
  100. package/components/stepper/stepper-item.yaml +11 -0
  101. package/components/stepper/stepper.a2ui.json +38 -3
  102. package/components/stepper/stepper.class.js +199 -2
  103. package/components/stepper/stepper.css +30 -0
  104. package/components/stepper/stepper.d.ts +28 -1
  105. package/components/stepper/stepper.yaml +76 -2
  106. package/components/stream/stream.d.ts +3 -3
  107. package/components/swatch/swatch.d.ts +1 -1
  108. package/components/swiper/swiper.d.ts +3 -3
  109. package/components/table/cell-types.js +12 -1
  110. package/components/table/table.a2ui.json +2 -2
  111. package/components/table/table.d.ts +7 -7
  112. package/components/table/table.yaml +9 -1
  113. package/components/table-toolbar/table-toolbar.class.js +1 -1
  114. package/components/table-toolbar/table-toolbar.d.ts +4 -4
  115. package/components/tabs/tabs.d.ts +1 -1
  116. package/components/tag/tag.a2ui.json +5 -5
  117. package/components/tag/tag.class.js +1 -1
  118. package/components/tag/tag.css +149 -71
  119. package/components/tag/tag.d.ts +21 -11
  120. package/components/tag/tag.examples.md +4 -4
  121. package/components/tag/tag.yaml +35 -13
  122. package/components/tags-input/tags-input.d.ts +4 -4
  123. package/components/timeline/timeline.d.ts +1 -1
  124. package/components/toast/toast.a2ui.json +2 -4
  125. package/components/toast/toast.css +0 -12
  126. package/components/toast/toast.yaml +3 -4
  127. package/components/toc/toc.d.ts +1 -1
  128. package/components/toggle-group/toggle-group.d.ts +1 -1
  129. package/components/toggle-scheme/toggle-scheme.d.ts +1 -1
  130. package/components/tour/tour.d.ts +4 -4
  131. package/components/tree/tree.d.ts +1 -1
  132. package/core/icons-phosphor.js +129 -71
  133. package/core/provider.js +84 -23
  134. package/dist/host.min.css +1 -1
  135. package/dist/host.sheet.js +1 -1
  136. package/dist/theme-provider.min.js +1 -1
  137. package/dist/web-components.min.css +1 -1
  138. package/dist/web-components.min.js +90 -88
  139. package/dist/web-components.sheet.js +1 -1
  140. package/package.json +1 -1
  141. package/patterns/admin-keys-and-export/admin-keys-and-export.examples.html +1 -1
  142. package/patterns/agent-memory/agent-memory.examples.html +5 -5
  143. package/patterns/agent-prompt-library/agent-prompt-library.examples.html +2 -2
  144. package/patterns/audit-log/audit-log.examples.js +12 -5
  145. package/patterns/bulk-action-toolbar/bulk-action-toolbar.examples.js +4 -1
  146. package/patterns/changelog-feed/changelog-feed.examples.html +1 -1
  147. package/patterns/comments-and-collaboration/comments-and-collaboration.examples.html +1 -1
  148. package/patterns/conversion-funnel/conversion-funnel.examples.html +1 -1
  149. package/patterns/diff-review/diff-review.examples.html +9 -9
  150. package/patterns/filter-bar/filter-bar.examples.html +12 -8
  151. package/patterns/filter-bar/filter-bar.examples.js +4 -1
  152. package/patterns/marketing-engagement/marketing-engagement.examples.html +1 -1
  153. package/patterns/notifications-bell-and-digest/notifications-bell-and-digest.examples.html +1 -1
  154. package/patterns/permissions-matrix/permissions-matrix.examples.html +1 -1
  155. package/patterns/permissions-sharing/permissions-sharing.examples.html +1 -1
  156. package/patterns/profile-public-and-verification/profile-public-and-verification.examples.html +2 -2
  157. package/patterns/record-detail-drawer/record-detail-drawer.examples.html +1 -1
  158. package/patterns/retention-cohort/retention-cohort.examples.html +1 -1
  159. package/patterns/retention-cohort/retention-cohort.examples.js +4 -1
  160. package/patterns/system-banners/system-banners.examples.html +3 -3
  161. package/styles/api/sizing-fallback.css +32 -0
  162. package/styles/api/sizing.css +7 -3
  163. package/styles/components.css +1 -0
  164. package/styles/tokens.css +1 -0
@@ -48,14 +48,14 @@ export class UIAlert extends UIElement {
48
48
  reason: '' | 'declined' | 'expired' | 'insufficient' | 'network';
49
49
  /** Single-line alert message. For two-line "headline + body" alerts, use [title] + [description] instead. For rich content (links, formatting), use the [slot="content"] slot. */
50
50
  text: string;
51
- /** Semantic color variant. */
52
- variant: 'default' | 'info' | 'success' | 'warning' | 'danger' | 'muted' | 'neutral';
51
+ /** Semantic severity family — the only color axis alert exposes. A quiet/passive banner is the family-less `default` (no attribute): the retired `muted`/`neutral` values were exact aliases of it. */
52
+ variant: 'default' | 'info' | 'success' | 'warning' | 'danger';
53
53
 
54
+ addEventListener(type: 'close', listener: (ev: AlertCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
55
+ addEventListener(type: 'dunning-action', listener: (ev: AlertDunningActionEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
54
56
  addEventListener<K extends keyof HTMLElementEventMap>(
55
57
  type: K,
56
58
  listener: (this: UIAlert, ev: HTMLElementEventMap[K]) => unknown,
57
59
  options?: boolean | AddEventListenerOptions,
58
60
  ): void;
59
- addEventListener(type: 'close', listener: (ev: AlertCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
60
- addEventListener(type: 'dunning-action', listener: (ev: AlertDunningActionEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
61
61
  }
@@ -58,7 +58,10 @@ props:
58
58
  type: string
59
59
  default: ""
60
60
  variant:
61
- description: Semantic color variant.
61
+ description: >-
62
+ Semantic severity family — the only color axis alert exposes. A
63
+ quiet/passive banner is the family-less `default` (no attribute):
64
+ the retired `muted`/`neutral` values were exact aliases of it.
62
65
  type: string
63
66
  default: default
64
67
  enum:
@@ -67,8 +70,6 @@ props:
67
70
  - success
68
71
  - warning
69
72
  - danger
70
- - muted
71
- - neutral
72
73
  pattern:
73
74
  description: >-
74
75
  Domain pattern mode. Default is empty (standard alert). Setting
@@ -177,7 +178,7 @@ requiredIcons:
177
178
  - x
178
179
  a2ui:
179
180
  rules:
180
- - rule: 'Inline alert/banner for status messages within a content region. Severity via variant (info, success, warn, error).'
181
+ - rule: 'Inline alert/banner for status messages within a content region. Severity via variant (info, success, warning, danger) — those four plus the family-less default are the whole enum.'
181
182
  reason: 'Canonical inline-alert primitive.'
182
183
  - rule: 'For ephemeral toast notifications use <toast-ui> (or post to <feed-ui>); alert-ui is persistent inline.'
183
184
  reason: 'Ephemeral vs persistent boundary.'
@@ -233,7 +234,7 @@ examples:
233
234
  {
234
235
  "id": "alert",
235
236
  "component": "Alert",
236
- "variant": "error",
237
+ "variant": "danger",
237
238
  "title": "Something went wrong",
238
239
  "description": "We encountered an error while loading the data. Please try again."
239
240
  },
@@ -25,11 +25,11 @@ export class UIAnchorBar extends UIElement {
25
25
  /** false (default) anchors to the nearest scroll container via `position: sticky` — safe for content with ResizeObserver-driven children (e.g. <toolbar-ui>'s overflow measurement never sees a display:none reset). true anchors to the browser viewport via `position: fixed` + Popover API top-layer promotion — note the native Popover UA stylesheet applies `display:none` while closed, which DOES reset ResizeObserver-driven children on first open; prefer the default for content wrapping <toolbar-ui>. */
26
26
  viewport: boolean;
27
27
 
28
+ addEventListener(type: 'close', listener: (ev: AnchorBarCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
29
+ addEventListener(type: 'open', listener: (ev: AnchorBarOpenEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
28
30
  addEventListener<K extends keyof HTMLElementEventMap>(
29
31
  type: K,
30
32
  listener: (this: UIAnchorBar, ev: HTMLElementEventMap[K]) => unknown,
31
33
  options?: boolean | AddEventListenerOptions,
32
34
  ): void;
33
- addEventListener(type: 'close', listener: (ev: AnchorBarCloseEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
34
- addEventListener(type: 'open', listener: (ev: AnchorBarOpenEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
35
35
  }
@@ -80,7 +80,6 @@ export class UIAvatar extends UIElement {
80
80
  if (this.#initialsEl) { this.#initialsEl.remove(); this.#initialsEl = null; }
81
81
  if (!this.#iconEl) {
82
82
  this.#iconEl = document.createElement('icon-ui');
83
- this.#iconEl.setAttribute('slot', 'icon');
84
83
  this.appendChild(this.#iconEl);
85
84
  }
86
85
  this.#iconEl.setAttribute('name', this.icon);
@@ -49,8 +49,22 @@
49
49
  line-height: 1;
50
50
  }
51
51
 
52
- /* ── Icon (non-person avatar) ── */
53
- [slot="icon"] {
52
+ /* ── Icon (non-person avatar) ──
53
+ Selected by tag (`:scope > icon-ui`), not `[slot="icon"]` — this
54
+ repo's Light-DOM stance treats `slot=` as decorative metadata,
55
+ positioning is by tag + ancestor + DOM order (AGENTS.md). That
56
+ matters here beyond style: avatar-ui is commonly placed AS a
57
+ container's own `slot="icon"` child (list-item-ui rows, e.g. the
58
+ admin-dashboard Notifications list — see issue 809), and Light DOM has
59
+ no shadow boundary, so an ancestor's `[slot="icon"]` selector
60
+ (meant for the outer avatar-ui) was ALSO matching avatar's inner
61
+ icon-ui when both carried the same attribute — list-item.css's
62
+ `margin-inline-end` (icon-to-text gap) leaked onto the inner
63
+ icon-ui and pushed the flex-centered glyph off-center. The inner
64
+ icon-ui no longer carries `slot="icon"` at all (avatar.class.js)
65
+ — a direct-child tag selector needs no shared attribute to hang
66
+ off, so the collision is impossible rather than out-specificity'd. */
67
+ :scope > icon-ui {
54
68
  color: var(--avatar-fg);
55
69
  --a-icon-size: calc(var(--avatar-size) * 0.55);
56
70
  display: inline-flex;
@@ -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/Badge.json",
4
4
  "title": "Badge",
5
- "description": "Inline pill-shaped badge — READ-ONLY status flag, count, or\nnotification dot. Text rendered via CSS `attr(text)`. Distinct from\n<tag-ui>, which is INTERACTIVE / removable and fires a `remove`\nevent. Use badge-ui for status flags (Beta / New / Deprecated),\nnotification counts, and unread indicators; use tag-ui for filter\nchips or user-managed labels.\n",
5
+ "description": "Inline pill-shaped badge — READ-ONLY status flag, count, or\nnotification dot. Text rendered via CSS `attr(text)`. Distinct from\n<tag-ui>, which is INTERACTIVE / removable and fires a `remove`\nevent. Use badge-ui for status flags (Beta / New / Deprecated),\nnotification counts, and unread indicators; use tag-ui for filter\nchips or user-managed labels.\n\nREGISTER (gh issue 845; weight revised gh#866): badge and tag share\nthe same geometry family — pill radius (`--a-radius-full`) and\npadding token rhythm are identical, so shape is NOT how you tell\nthem apart. Typography is: badge is UPPERCASE, mono (kbd-ui's\n`--a-font-family-code` stack), medium weight, wide-tracked\n(`--a-font-tracking-wider`, 0.06em), tabular numerals for counts.\nTag stays proportional sentence-case, also weight 500 — weight no\nlonger distinguishes the two (gh#866); case + tracking + mono carry\nthe register split now. Neither component exposes a prop that\ncrosses this line; the registers cannot be mixed à la carte.\nRemaining distinctions: badge is non-interactive and carries the\nsemantic-color voice (status tones ARE the message, solid by\ndefault — gh#864); tag is interactive/removable, muted/tinted by\ndefault for family variants (gh#864), solid by default for the\nfamily-less variant (gh#794, unaffected by gh#864).\n",
6
6
  "type": "object",
7
7
  "allOf": [
8
8
  {
@@ -32,7 +32,7 @@
32
32
  "default": "md"
33
33
  },
34
34
  "status": {
35
- "description": "Semantic status shorthand. Auto-maps to variant and sets text. `new` → success \"New\"; `updated` → info \"Updated\"; `deprecated` → warning \"Deprecated\"; `removed` → danger \"Removed\"; `beta` → accent \"Beta\". Use `variant` + `text` directly for custom chips.",
35
+ "description": "Semantic status shorthand. Auto-maps to variant and sets text. `new` → success \"New\"; `updated` → info \"Updated\"; `deprecated` → warning \"Deprecated\"; `removed` → danger \"Removed\"; `beta` → primary \"Beta\". Use `variant` + `text` directly for custom chips.",
36
36
  "type": "string",
37
37
  "enum": [
38
38
  "new",
@@ -53,28 +53,25 @@
53
53
  "$ref": "common_types.json#/$defs/DynamicString"
54
54
  },
55
55
  "tone": {
56
- "description": "Fill style — orthogonal to [variant]. Badge defaults to `muted`\n(quiet metadata is the primitive's identity counts, IDs, status\npills in dense rows). Three values:\n - `muted` (default) — tinted bg + scheme-paired text. Same as\n the existing family-variant rules.\n - `solid` — saturated bg + on-strong text. Use for hero badges\n where the badge IS the state (e.g. a single inline error). The\n existing `primary` variant is a shortcut for accent + solid.\n - `outline` — transparent bg + family-colored border + family-\n colored text. Lightest visual weight; good in dense data rows.\nVocabulary mirrors `<tag-ui>` (which defaults to solid, given its\ndifferent role as filter / autocomplete chip).\n",
56
+ "description": "Fill style — orthogonal to [variant]. Badge defaults to `solid`\n(gh#864 badge and tag were swapped relative to their reported\ndefault formulas; this restores badge's own). Three values:\n - `solid` (default) — saturated bg + on-strong text. The badge\n IS the state (status stamp). `primary` is badge's sole\n brand-emphasis variant (`accent` retired, gh#874).\n - `muted` — tinted bg + scheme-paired text. Use for quiet\n metadata counts, IDs, status pills in dense rows. Family-tinted\n `muted` (e.g. `variant=\"info\" tone=\"muted\"`) shares `<tag-ui>`'s\n `[tone=\"muted\"]` shape; family-less `tone=\"muted\"` does NOT\n (gh#873) — it renders the stronger `neutral-low` fill, while\n `<tag-ui>`'s family-less muted stays on the lighter\n `--a-bg-muted` pair (gh#778 dense-list rationale).\n - `outline` — transparent bg + family-colored border + family-\n colored text. Lightest visual weight; good in dense data rows.\nVocabulary mirrors `<tag-ui>` (which now defaults to `muted` for\nits family variants, gh#864 different role as filter /\nautocomplete chip).\n",
57
57
  "type": "string",
58
58
  "enum": [
59
59
  "muted",
60
60
  "solid",
61
61
  "outline"
62
62
  ],
63
- "default": "muted"
63
+ "default": "solid"
64
64
  },
65
65
  "variant": {
66
66
  "description": "Semantic color variant.",
67
67
  "type": "string",
68
68
  "enum": [
69
69
  "default",
70
- "accent",
71
70
  "info",
72
71
  "success",
73
72
  "warning",
74
73
  "danger",
75
- "primary",
76
- "muted",
77
- "neutral"
74
+ "primary"
78
75
  ],
79
76
  "default": "default"
80
77
  }
@@ -94,7 +91,7 @@
94
91
  "examples": [
95
92
  {
96
93
  "description": "Horizontal chart legend — Row of Badges with icon=\"dot\". Each badge's variant supplies the dot color. CANONICAL PATTERN: do NOT compose legends as Row(Row(Badge[text=●], Text), …) — that produces rows-of-rows markup. Use one Badge[icon=dot, text=label, variant=color] per series instead.",
97
- "a2ui": "[\n {\n \"id\": \"legend\",\n \"component\": \"Row\",\n \"gap\": \"3\",\n \"align\": \"center\",\n \"children\": [\n \"l1\",\n \"l2\",\n \"l3\",\n \"l4\"\n ]\n },\n {\n \"id\": \"l1\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Organic\",\n \"variant\": \"accent\",\n \"size\": \"sm\"\n },\n {\n \"id\": \"l2\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Direct\",\n \"variant\": \"success\",\n \"size\": \"sm\"\n },\n {\n \"id\": \"l3\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Referral\",\n \"variant\": \"warning\",\n \"size\": \"sm\"\n },\n {\n \"id\": \"l4\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Social\",\n \"variant\": \"info\",\n \"size\": \"sm\"\n }\n]",
94
+ "a2ui": "[\n {\n \"id\": \"legend\",\n \"component\": \"Row\",\n \"gap\": \"3\",\n \"align\": \"center\",\n \"children\": [\n \"l1\",\n \"l2\",\n \"l3\",\n \"l4\"\n ]\n },\n {\n \"id\": \"l1\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Organic\",\n \"variant\": \"primary\",\n \"size\": \"sm\"\n },\n {\n \"id\": \"l2\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Direct\",\n \"variant\": \"success\",\n \"size\": \"sm\"\n },\n {\n \"id\": \"l3\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Referral\",\n \"variant\": \"warning\",\n \"size\": \"sm\"\n },\n {\n \"id\": \"l4\",\n \"component\": \"Badge\",\n \"icon\": \"dot\",\n \"text\": \"Social\",\n \"variant\": \"info\",\n \"size\": \"sm\"\n }\n]",
98
95
  "name": "chart-legend"
99
96
  },
100
97
  {
@@ -12,14 +12,14 @@
12
12
  */
13
13
 
14
14
  /**
15
- * <badge-ui text="New" variant="accent"></badge-ui>
15
+ * <badge-ui text="New" variant="primary"></badge-ui>
16
16
  * <badge-ui text="3" variant="danger" size="sm"></badge-ui>
17
- * <badge-ui text="Organic" variant="accent" icon="dot"></badge-ui> ← chart legend chip
17
+ * <badge-ui text="Organic" variant="primary" icon="dot"></badge-ui> ← chart legend chip
18
18
  * <badge-ui status="beta"></badge-ui> ← status shorthand
19
19
  *
20
20
  * Inline badge / tag. Pill-shaped, text rendered via CSS attr().
21
21
  *
22
- * Variants: default, accent, info, success, warning, danger, primary, muted, neutral
22
+ * Variants: default, info, success, warning, danger, primary
23
23
  * Sizes: sm, md (default)
24
24
  * Icon: optional leading icon (any registered icon name; "dot" for legend
25
25
  * markers). Inherits the variant's foreground color so legend chips
@@ -34,7 +34,7 @@ const STATUS_MAP = {
34
34
  updated: { variant: 'info', text: 'Updated' },
35
35
  deprecated: { variant: 'warning', text: 'Deprecated' },
36
36
  removed: { variant: 'danger', text: 'Removed' },
37
- beta: { variant: 'accent', text: 'Beta' },
37
+ beta: { variant: 'primary', text: 'Beta' },
38
38
  };
39
39
 
40
40
  export class UIBadge extends UIElement {
@@ -1,14 +1,52 @@
1
1
  @scope (badge-ui) {
2
2
  :where(:scope) {
3
- /* ── Tokens ── */
4
- --badge-bg: var(--a-bg-muted);
5
- --badge-fg: var(--md-sys-color-neutral-on-surface);
6
- --badge-radius: var(--a-radius-md);
3
+ /* ── Tokens ──
4
+ The family-less default was still `--a-bg-muted` + `-on-surface`
5
+ (quiet chrome) even after gh#864 made every family variant solid
6
+ by default — an inconsistency the swap missed, since it only
7
+ touched variants that HAD a family. Moved to the real
8
+ `--md-sys-color-neutral`/`-on-neutral` pair (operator ruling,
9
+ 2026-08-10) — the true parallel to `-primary`/`-on-primary` etc.,
10
+ matching badge's own "solid by default" register and <tag-ui>'s
11
+ already-solid neutral default. `[tone="muted"]` (below) still
12
+ opts into the quiet chrome this rule used to carry unconditionally. */
13
+ --badge-bg: var(--md-sys-color-neutral);
14
+ --badge-fg: var(--md-sys-color-neutral-on-neutral);
15
+ /* ── Geometry (issue 845) — aligned to tag-ui's token rhythm. Radius now
16
+ consumes the SAME --a-radius-full pill tag-ui uses (was --a-radius-md,
17
+ a squarer chip) — shape is no longer the differentiation axis between
18
+ the two (operator ruling, issue 845). Padding already shared tag's
19
+ exact token structure pre-845 (see the size-tier comment below) —
20
+ only radius moved. */
21
+ --badge-radius: var(--a-radius-full);
7
22
  --badge-px: var(--a-space-1-5);
8
- --badge-py: 2px;
23
+ --badge-py: var(--a-space-0-5);
9
24
  --badge-gap: var(--a-space-1);
10
25
  --badge-font-size: var(--a-ui-sm);
11
- --badge-font-family: var(--a-font-family-ui);
26
+ /* ── Typographic register (issue 845; weight revised gh#866) — mono
27
+ TRIAL taken: kbd-ui's own stack (--a-font-family-code, kbd.css) held
28
+ up at small badge sizes (roughly a dozen logical pixels) in both
29
+ schemes once paired with wide tracking (screenshot-verified, see PR
30
+ body) — did not read starved/gappy, so the trial's fallback branch
31
+ (tracked-caps sans) was not needed. Weight moved semibold → medium
32
+ (gh#866) — it no longer distinguishes badge from tag (tag is also
33
+ weight 500). Uppercase + wide tracking + mono + tabular-nums is the
34
+ register now — this is what makes a badge unmistakably NOT a tag
35
+ (which stays proportional sentence-case) at a glance. */
36
+ --badge-font-family: var(--a-font-family-code);
37
+ --badge-weight: var(--a-weight-medium);
38
+ --badge-tracking: var(--a-font-tracking-wider); /* 0.06em — within the +0.04–0.08em ruling */
39
+
40
+ /* ── Size tiers (gh#779) — md (above) is the pixel-identical default.
41
+ Component-owned ladder, not a direct alias of the universal
42
+ --a-ui-px/--a-ui-size tokens — see tag.css's identical note (badge
43
+ and tag share this md baseline and this exact reasoning). */
44
+ --badge-px-sm: var(--a-space-1);
45
+ --badge-px-lg: var(--a-space-2);
46
+ --badge-py-sm: var(--a-space-px);
47
+ --badge-py-lg: var(--a-space-1);
48
+ --badge-font-size-sm: var(--a-ui-xs);
49
+ --badge-font-size-lg: var(--a-ui-md);
12
50
  text-align: start; /* §text-align-reset — blocks inheritance from centered ancestors */
13
51
  }
14
52
 
@@ -27,8 +65,15 @@
27
65
  /* font-family floor — see segment.css rationale. */
28
66
  font-family: var(--badge-font-family);
29
67
  font-size: var(--badge-font-size);
30
- font-weight: 500;
68
+ font-weight: var(--badge-weight);
31
69
  line-height: 1;
70
+ /* ── Register (issue 845) — uppercase + tracking + tabular numerals is the
71
+ badge/tag differentiator now that geometry is shared (see the
72
+ --badge-radius note above). Tag stays proportional sentence-case at
73
+ weight 500 (tag.css) — never uppercase, never tracked. */
74
+ text-transform: uppercase;
75
+ letter-spacing: var(--badge-tracking);
76
+ font-variant-numeric: tabular-nums;
32
77
  border-radius: var(--badge-radius);
33
78
  white-space: nowrap;
34
79
  vertical-align: middle;
@@ -45,7 +90,7 @@
45
90
 
46
91
  /* Leading icon stamped by JS (when [icon] is set). Inherits the badge's
47
92
  foreground color so legend chips read as a single color-coded unit
48
- (e.g. accent variant → accent-colored dot + accent-colored label).
93
+ (e.g. primary variant → primary-colored dot + primary-colored label).
49
94
  ICON-HEIGHT FIX: cap the icon block-size so it cannot exceed the text
50
95
  line-height. `line-height:1` on the badge drives the block size via
51
96
  the text glyph; an icon taller than 1em would inflate the row. */
@@ -67,93 +112,91 @@
67
112
  }
68
113
 
69
114
  /* ── Variants ──
70
- Badge fg pairs with the muted (tinted) bg — use --a-{family}-text, which
71
- flips with scheme (shade in light, tint in dark) for proper contrast.
72
- --a-{family}-text-strong is for solid fills (--a-{family}-bg) and would
73
- collapse contrast on muted: warning fails in dark, danger fails in light.
74
- Accent keeps the saturated-text-on-tint look (intentional brand emphasis). */
75
- :scope[variant="accent"] {
76
- --badge-bg: var(--md-sys-color-primary-container);
77
- --badge-fg: var(--md-sys-color-primary-on-surface);
78
- }
115
+ Family fg pairs with the family's own solid bg — this is badge's
116
+ default tone (gh#864). Badge and tag had been implementing each
117
+ OTHER's reported default formula (gh#794 flipped tag's bare default to
118
+ solid a day before gh#845 ratified badge's register, with no cross-
119
+ check between the two changes) this restores badge's own: saturated
120
+ `--a-{family}-bg` + Material's on-color (`-on-{family}`, near-white by
121
+ the fixed-light-on-color law). Reads as a status stamp — the badge IS
122
+ the state. `[tone="muted"]` below opts into the tinted-container pair
123
+ instead (the shape this rule used to carry pre-gh#864).
79
124
 
125
+ Warning uses --a-warning-bg (semantics.css L3 redirect to the bright-
126
+ amber -20-tint) rather than the raw family token, which would collapse
127
+ to muddy brown-on-brown (-on-warning is dark, the raw mid-tone bg
128
+ isn't). See <tag-ui>'s identical workaround. */
80
129
  :scope[variant="info"] {
81
- --badge-bg: var(--md-sys-color-info-container);
82
- --badge-fg: var(--md-sys-color-info-on-surface);
130
+ --badge-bg: var(--a-info-bg);
131
+ --badge-fg: var(--md-sys-color-info-on-info);
83
132
  }
84
133
 
85
134
  :scope[variant="success"] {
86
- --badge-bg: var(--md-sys-color-success-container);
87
- --badge-fg: var(--md-sys-color-success-on-surface);
135
+ --badge-bg: var(--a-success-bg);
136
+ --badge-fg: var(--md-sys-color-success-on-success);
88
137
  }
89
138
 
90
139
  :scope[variant="warning"] {
91
- --badge-bg: var(--md-sys-color-warning-container);
92
- --badge-fg: var(--md-sys-color-warning-on-surface);
140
+ --badge-bg: var(--a-warning-bg);
141
+ --badge-fg: var(--md-sys-color-warning-on-warning);
93
142
  }
94
143
 
95
144
  :scope[variant="danger"] {
96
- --badge-bg: var(--md-sys-color-danger-container);
97
- --badge-fg: var(--md-sys-color-danger-on-surface);
145
+ --badge-bg: var(--a-danger-bg);
146
+ --badge-fg: var(--md-sys-color-danger-on-danger);
98
147
  }
99
148
 
100
- /* `primary` is the accent-filled variant — solid bg + on-accent text,
101
- used for "PRO"-style emphasis chips that should read as a brand
102
- stamp rather than tinted-on-canvas. Uses the L3 primary-* surface
103
- matrix so it tracks the same accent-strong source as button-ui's
104
- primary variant. */
149
+ /* `primary` is badge's sole brand-emphasis variant (accent retired,
150
+ gh#874 this rule is the identical solid pair the deleted
151
+ [variant="accent"] rule used to carry; renamed, not restyled).
152
+ Uses the L3 primary-* surface matrix so it tracks the same source
153
+ as button-ui's primary variant. */
105
154
  :scope[variant="primary"] {
106
155
  --badge-bg: var(--a-primary-bg);
107
156
  --badge-fg: var(--md-sys-color-primary-on-primary);
108
157
  }
109
158
 
110
- /* `muted` and `neutral` are semantic aliases of the base — same tokens
111
- as the default variant, declared explicitly so the yaml enum and the
112
- CSS contract agree. Use cases: passive metadata chips (counts, IDs,
113
- "Not set" states) where the badge should read as quiet chrome. */
114
- :scope[variant="muted"],
115
- :scope[variant="neutral"] {
116
- --badge-bg: var(--a-bg-muted);
117
- --badge-fg: var(--md-sys-color-neutral-on-surface);
118
- }
119
-
120
159
  /* ── Tone modifier — orthogonal to [variant] ──
121
- Badge's default tone is `muted` (the rules above) — quiet metadata is
122
- the primitive's identity. `[tone="solid"]` opts into the saturated-fill
123
- pair (same shape <tag-ui>'s solid default uses); `[tone="outline"]`
124
- into the transparent-fill + colored-ring shape. Same vocabulary as
125
- <tag-ui>; different defaults reflecting each primitive's role.
126
-
127
- Warning uses --a-warning-20-tint as bg (a bright amber, scheme-
128
- independent) instead of --a-warning-bg — the latter pair collapses
129
- to muddy brown-on-brown (-text-strong is dark, -bg is mid-tone).
130
- See <tag-ui>'s identical workaround. Token-system follow-up planned. */
131
- :scope[tone="solid"][variant="info"] {
132
- --badge-bg: var(--a-info-bg);
133
- --badge-fg: var(--md-sys-color-info-on-info);
160
+ Badge's default tone is `solid` (the family rules above, gh#864).
161
+ `[tone="muted"]` opts into the tinted-container pair (family-container
162
+ bg + family-on-surface fg — the shape <tag-ui>'s own default now uses,
163
+ gh#864); `[tone="outline"]` into the transparent-fill + colored-ring
164
+ shape. Same vocabulary as <tag-ui>; each component's default now
165
+ matches its own reported target instead of the other's. */
166
+ :scope[tone="muted"][variant="info"] {
167
+ --badge-bg: var(--md-sys-color-info-container);
168
+ --badge-fg: var(--md-sys-color-info-on-surface);
134
169
  }
135
- :scope[tone="solid"][variant="success"] {
136
- --badge-bg: var(--a-success-bg);
137
- --badge-fg: var(--md-sys-color-success-on-success);
170
+ :scope[tone="muted"][variant="success"] {
171
+ --badge-bg: var(--md-sys-color-success-container);
172
+ --badge-fg: var(--md-sys-color-success-on-surface);
138
173
  }
139
- :scope[tone="solid"][variant="warning"] {
140
- /* --a-warning-bg is the bright-amber step (semantics.css L3 redirect
141
- to -20-tint) — see also <tag-ui>'s warning solid pair. */
142
- --badge-bg: var(--a-warning-bg);
143
- --badge-fg: var(--md-sys-color-warning-on-warning);
174
+ :scope[tone="muted"][variant="warning"] {
175
+ --badge-bg: var(--md-sys-color-warning-container);
176
+ --badge-fg: var(--md-sys-color-warning-on-surface);
144
177
  }
145
- :scope[tone="solid"][variant="danger"] {
146
- --badge-bg: var(--a-danger-bg);
147
- --badge-fg: var(--md-sys-color-danger-on-danger);
178
+ :scope[tone="muted"][variant="danger"] {
179
+ --badge-bg: var(--md-sys-color-danger-container);
180
+ --badge-fg: var(--md-sys-color-danger-on-surface);
148
181
  }
149
- :scope[tone="solid"][variant="accent"] {
150
- --badge-bg: var(--a-primary-bg);
151
- --badge-fg: var(--md-sys-color-primary-on-primary);
182
+ :scope[tone="muted"][variant="primary"] {
183
+ --badge-bg: var(--md-sys-color-primary-container);
184
+ --badge-fg: var(--md-sys-color-primary-on-surface);
152
185
  }
153
- /* Solid on neutral default high-contrast inverse stamp. */
154
- :scope[tone="solid"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="accent"]):not([variant="primary"]) {
155
- --badge-bg: var(--md-sys-color-neutral-on-surface);
156
- --badge-fg: var(--md-sys-color-neutral-background);
186
+ /* Family-less muted the quiet-chrome opt-out for passive metadata
187
+ chips (counts, IDs, "Not set"). bg is the neutral-low fill (gh#873;
188
+ first consumer of this token) paired with neutral-on-surface text —
189
+ NOT the requested neutral-high, which measures ~3:1 against
190
+ neutral-low in both schemes and fails AA at badge's ~12px text size
191
+ (pair is roster-gated in verify:contrast). Distinct from the base
192
+ (no-attribute) default, which is solid neutral/on-neutral (commit
193
+ 984a4401e) — muted is the quieter tint, solid is the stamp. NB
194
+ tag-ui's family-less [tone="muted"] intentionally stays on the
195
+ lighter --a-bg-muted pair (gh#778 dense-list rationale) — the two
196
+ components' family-less muteds are no longer the same shape. */
197
+ :scope[tone="muted"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="primary"]) {
198
+ --badge-bg: var(--md-sys-color-neutral-low);
199
+ --badge-fg: var(--md-sys-color-neutral-on-surface);
157
200
  }
158
201
 
159
202
  /* ── `[tone="outline"]` — transparent bg + family-colored border + text ── */
@@ -177,15 +220,32 @@
177
220
  --badge-fg: var(--md-sys-color-danger-on-surface);
178
221
  --badge-border: var(--md-sys-color-danger-outline);
179
222
  }
180
- :scope[tone="outline"][variant="accent"] {
223
+ :scope[tone="outline"][variant="primary"] {
181
224
  --badge-fg: var(--md-sys-color-primary-on-surface);
182
225
  --badge-border: var(--md-sys-color-primary-outline);
183
226
  }
184
227
  /* Outline on neutral — fg-muted text + subtle ring. */
185
- :scope[tone="outline"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="accent"]):not([variant="primary"]) {
228
+ :scope[tone="outline"]:not([variant="info"]):not([variant="success"]):not([variant="warning"]):not([variant="danger"]):not([variant="primary"]) {
186
229
  --badge-fg: var(--a-fg-muted);
187
230
  --badge-border: var(--md-sys-color-neutral-outline);
188
231
  }
189
232
 
190
- /* Size handled by universal [size] attribute system. */
233
+ /* ── Size tiers (gh#779) re-point the active tokens to the matching
234
+ tier; the token defaults at :where(:scope) above ARE the md tier, so
235
+ [size="md"] is declared only for explicitness (mirrors kbd.css). */
236
+ :scope[size="sm"] {
237
+ --badge-px: var(--badge-px-sm);
238
+ --badge-py: var(--badge-py-sm);
239
+ --badge-font-size: var(--badge-font-size-sm);
240
+ }
241
+ :scope[size="md"] {
242
+ --badge-px: var(--a-space-1-5);
243
+ --badge-py: var(--a-space-0-5);
244
+ --badge-font-size: var(--a-ui-sm);
245
+ }
246
+ :scope[size="lg"] {
247
+ --badge-px: var(--badge-px-lg);
248
+ --badge-py: var(--badge-py-lg);
249
+ --badge-font-size: var(--badge-font-size-lg);
250
+ }
191
251
  }
@@ -6,6 +6,22 @@ event. Use badge-ui for status flags (Beta / New / Deprecated),
6
6
  notification counts, and unread indicators; use tag-ui for filter
7
7
  chips or user-managed labels.
8
8
 
9
+ REGISTER (gh issue 845; weight revised gh#866): badge and tag share
10
+ the same geometry family — pill radius (`--a-radius-full`) and
11
+ padding token rhythm are identical, so shape is NOT how you tell
12
+ them apart. Typography is: badge is UPPERCASE, mono (kbd-ui's
13
+ `--a-font-family-code` stack), medium weight, wide-tracked
14
+ (`--a-font-tracking-wider`, 0.06em), tabular numerals for counts.
15
+ Tag stays proportional sentence-case, also weight 500 — weight no
16
+ longer distinguishes the two (gh#866); case + tracking + mono carry
17
+ the register split now. Neither component exposes a prop that
18
+ crosses this line; the registers cannot be mixed à la carte.
19
+ Remaining distinctions: badge is non-interactive and carries the
20
+ semantic-color voice (status tones ARE the message, solid by
21
+ default — gh#864); tag is interactive/removable, muted/tinted by
22
+ default for family variants (gh#864), solid by default for the
23
+ family-less variant (gh#794, unaffected by gh#864).
24
+
9
25
  *
10
26
  * @see https://ui-kit.exe.xyz/site/components/badge
11
27
  *
@@ -23,26 +39,32 @@ export class UIBadge extends UIElement {
23
39
  icon: string;
24
40
  /** Badge size (sm/md/lg). For a denser or larger register, set [scale] on an ancestor. */
25
41
  size: 'sm' | 'md' | 'lg';
26
- /** Semantic status shorthand. Auto-maps to variant and sets text. `new` → success "New"; `updated` → info "Updated"; `deprecated` → warning "Deprecated"; `removed` → danger "Removed"; `beta` → accent "Beta". Use `variant` + `text` directly for custom chips. */
42
+ /** Semantic status shorthand. Auto-maps to variant and sets text. `new` → success "New"; `updated` → info "Updated"; `deprecated` → warning "Deprecated"; `removed` → danger "Removed"; `beta` → primary "Beta". Use `variant` + `text` directly for custom chips. */
27
43
  status: 'new' | 'updated' | 'deprecated' | 'removed' | 'beta';
28
44
  /** Badge text content. Falls back to existing textContent. */
29
45
  text: string;
30
46
  /** Badge display text. Renderer routes this to the `text` attribute via CSS attr(text) on ::after. */
31
47
  textContent: string;
32
- /** Fill style — orthogonal to [variant]. Badge defaults to `muted`
33
- (quiet metadata is the primitive's identity counts, IDs, status
34
- pills in dense rows). Three values:
35
- - `muted` (default) — tinted bg + scheme-paired text. Same as
36
- the existing family-variant rules.
37
- - `solid` saturated bg + on-strong text. Use for hero badges
38
- where the badge IS the state (e.g. a single inline error). The
39
- existing `primary` variant is a shortcut for accent + solid.
48
+ /** Fill style — orthogonal to [variant]. Badge defaults to `solid`
49
+ (gh#864 badge and tag were swapped relative to their reported
50
+ default formulas; this restores badge's own). Three values:
51
+ - `solid` (default) — saturated bg + on-strong text. The badge
52
+ IS the state (status stamp). `primary` is badge's sole
53
+ brand-emphasis variant (`accent` retired, gh#874).
54
+ - `muted` tinted bg + scheme-paired text. Use for quiet
55
+ metadata counts, IDs, status pills in dense rows. Family-tinted
56
+ `muted` (e.g. `variant="info" tone="muted"`) shares `<tag-ui>`'s
57
+ `[tone="muted"]` shape; family-less `tone="muted"` does NOT
58
+ (gh#873) — it renders the stronger `neutral-low` fill, while
59
+ `<tag-ui>`'s family-less muted stays on the lighter
60
+ `--a-bg-muted` pair (gh#778 dense-list rationale).
40
61
  - `outline` — transparent bg + family-colored border + family-
41
62
  colored text. Lightest visual weight; good in dense data rows.
42
- Vocabulary mirrors `<tag-ui>` (which defaults to solid, given its
43
- different role as filter / autocomplete chip).
63
+ Vocabulary mirrors `<tag-ui>` (which now defaults to `muted` for
64
+ its family variants, gh#864 — different role as filter /
65
+ autocomplete chip).
44
66
  */
45
67
  tone: 'muted' | 'solid' | 'outline';
46
68
  /** Semantic color variant. */
47
- variant: 'default' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 'primary' | 'muted' | 'neutral';
69
+ variant: 'default' | 'info' | 'success' | 'warning' | 'danger' | 'primary';
48
70
  }
@@ -46,5 +46,5 @@
46
46
  ## tone
47
47
 
48
48
  ```html
49
- <badge-ui text="Info" variant="info" tone="solid"></badge-ui>
49
+ <badge-ui text="Count" tone="muted"></badge-ui>
50
50
  ```